Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -34,8 +34,8 @@ def call_llama(prompt, max_tokens=1200):
|
|
| 34 |
if not token:
|
| 35 |
return "Model error: HF_TOKEN missing. Add your Hugging Face token as a Space secret named HF_TOKEN."
|
| 36 |
|
| 37 |
-
if
|
| 38 |
-
return "Model error: HF_TOKEN
|
| 39 |
|
| 40 |
try:
|
| 41 |
url = f"https://api-inference.huggingface.co/models/{MODEL}"
|
|
|
|
| 34 |
if not token:
|
| 35 |
return "Model error: HF_TOKEN missing. Add your Hugging Face token as a Space secret named HF_TOKEN."
|
| 36 |
|
| 37 |
+
if len(token) < 20:
|
| 38 |
+
return "Model error: HF_TOKEN appears invalid or too short."
|
| 39 |
|
| 40 |
try:
|
| 41 |
url = f"https://api-inference.huggingface.co/models/{MODEL}"
|