Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,16 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
6 |
from peft import PeftModel, PeftConfig
|
7 |
import uvicorn
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
class Query(BaseModel):
|
10 |
text: str
|
11 |
|
|
|
6 |
from peft import PeftModel, PeftConfig
|
7 |
import uvicorn
|
8 |
|
9 |
+
from huggingface_hub import login
|
10 |
+
|
11 |
+
# Authenticate with Hugging Face Hub
|
12 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
13 |
+
if HF_TOKEN:
|
14 |
+
login(token=HF_TOKEN)
|
15 |
+
else:
|
16 |
+
raise ValueError("Hugging Face token not found. Please set the HF_TOKEN environment variable.")
|
17 |
+
|
18 |
+
|
19 |
class Query(BaseModel):
|
20 |
text: str
|
21 |
|