Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -2
src/streamlit_app.py
CHANGED
|
@@ -9,7 +9,7 @@ model_id = "google/gemma-2b-it"
|
|
| 9 |
# 1. READ THE TOKEN: Get the Hugging Face Token from the Space Secrets
|
| 10 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 11 |
|
| 12 |
-
# 2. PASS THE TOKEN to the
|
| 13 |
tok = AutoTokenizer.from_pretrained(model_id, token=HF_TOKEN)
|
| 14 |
|
| 15 |
# Simplified Model Loading (trying to avoid complex quantization)
|
|
@@ -19,7 +19,7 @@ try:
|
|
| 19 |
model_id,
|
| 20 |
torch_dtype=torch.bfloat16,
|
| 21 |
device_map="auto",
|
| 22 |
-
token=HF_TOKEN
|
| 23 |
)
|
| 24 |
except Exception:
|
| 25 |
# Fallback to float16 if bfloat16 is not supported
|
|
|
|
| 9 |
# 1. READ THE TOKEN: Get the Hugging Face Token from the Space Secrets
|
| 10 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 11 |
|
| 12 |
+
# 2. PASS THE TOKEN to the tokenizer loading
|
| 13 |
tok = AutoTokenizer.from_pretrained(model_id, token=HF_TOKEN)
|
| 14 |
|
| 15 |
# Simplified Model Loading (trying to avoid complex quantization)
|
|
|
|
| 19 |
model_id,
|
| 20 |
torch_dtype=torch.bfloat16,
|
| 21 |
device_map="auto",
|
| 22 |
+
token=HF_TOKEN # PASS THE TOKEN to the model loading
|
| 23 |
)
|
| 24 |
except Exception:
|
| 25 |
# Fallback to float16 if bfloat16 is not supported
|