Spaces:
Sleeping
Sleeping
Update health_tracker_agent.py
Browse files- health_tracker_agent.py +7 -2
health_tracker_agent.py
CHANGED
@@ -1,9 +1,14 @@
|
|
|
|
1 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
2 |
from huggingface_hub import login
|
3 |
|
4 |
def track_health_status(input_text: str) -> str:
|
5 |
-
#
|
6 |
-
|
|
|
|
|
|
|
|
|
7 |
|
8 |
model_name = "m42-health/med42-70b"
|
9 |
|
|
|
1 |
+
import os
|
2 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
3 |
from huggingface_hub import login
|
4 |
|
5 |
def track_health_status(input_text: str) -> str:
|
6 |
+
# Get token from environment variable
|
7 |
+
hf_token = os.getenv("HF_TOKEN")
|
8 |
+
if not hf_token:
|
9 |
+
raise ValueError("Hugging Face token not set in environment variable 'HF_TOKEN'")
|
10 |
+
|
11 |
+
login(hf_token)
|
12 |
|
13 |
model_name = "m42-health/med42-70b"
|
14 |
|