Basementup commited on
Commit
4e10ae6
·
verified ·
1 Parent(s): 67ce39a

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 not token.startswith("hf_"):
38
- return "Model error: HF_TOKEN exists but does not look like a Hugging Face token. It should start with hf_."
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}"