ChemDave commited on
Commit
7e5c2d2
·
verified ·
1 Parent(s): 0afd22b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -6,19 +6,13 @@ client = InferenceClient(
6
  )
7
  def answer(question):
8
 
9
- try:
10
- response = client.chat.completions.create(
11
- model="Qwen/Qwen3-4B-Instruct-2507",
12
- messages=[
13
- {
14
- "role": "user",
15
- "content": question
16
- }
17
- ]
18
- )
19
 
20
- return response.choices[0].message.content
 
21
 
22
- except Exception as e:
23
- return f"ERROR: {type(e).__name__}: {str(e)}"
 
 
24
 
 
6
  )
7
  def answer(question):
8
 
9
+ token = os.environ.get("HF_TOKEN")
 
 
 
 
 
 
 
 
 
10
 
11
+ if token is None:
12
+ return "DIAGNOSTIC: HF_TOKEN was NOT found."
13
 
14
+ if token.startswith("hf_"):
15
+ return "DIAGNOSTIC: HF_TOKEN was found and has the expected format."
16
+
17
+ return "DIAGNOSTIC: HF_TOKEN was found, but its format looks unexpected."
18