Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,8 @@ from huggingface_hub import InferenceClient
|
|
| 6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 7 |
"""
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
def respond(
|
|
@@ -85,7 +86,9 @@ base_model = AutoModelForCausalLM.from_pretrained(
|
|
| 85 |
base_model_name,
|
| 86 |
torch_dtype=torch.float16,
|
| 87 |
device_map="auto",
|
| 88 |
-
|
|
|
|
|
|
|
| 89 |
)
|
| 90 |
|
| 91 |
# Load fine-tuned model
|
|
|
|
| 6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 7 |
"""
|
| 8 |
|
| 9 |
+
import os
|
| 10 |
+
client = InferenceClient(model="HuggingFaceH4/zephyr-7b-beta", token=os.getenv("HUGGINGFACEHUB_API_TOKEN"))
|
| 11 |
|
| 12 |
|
| 13 |
def respond(
|
|
|
|
| 86 |
base_model_name,
|
| 87 |
torch_dtype=torch.float16,
|
| 88 |
device_map="auto",
|
| 89 |
+
use_auth_token=api_token # ✅ Correct
|
| 90 |
+
)
|
| 91 |
+
|
| 92 |
)
|
| 93 |
|
| 94 |
# Load fine-tuned model
|