Update app.py
Browse files
app.py
CHANGED
|
@@ -6,19 +6,13 @@ client = InferenceClient(
|
|
| 6 |
)
|
| 7 |
def answer(question):
|
| 8 |
|
| 9 |
-
|
| 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 |
-
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
return
|
|
|
|
|
|
|
| 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 |
|