Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,10 @@ import os
|
|
12 |
from huggingface_hub import InferenceClient
|
13 |
|
14 |
HF_API_KEY = os.getenv("HF_API_KEY")
|
15 |
-
|
|
|
|
|
|
|
16 |
|
17 |
response = client.text_generation("Hello!", model="Qwen/Qwen2.5-Coder-32B-Instruct")
|
18 |
print(response)
|
|
|
12 |
from huggingface_hub import InferenceClient
|
13 |
|
14 |
HF_API_KEY = os.getenv("HF_API_KEY")
|
15 |
+
if not HF_API_KEY:
|
16 |
+
raise ValueError("HF_API_KEY is not set. Please add it as a secret in your Hugging Face Space settings.")
|
17 |
+
|
18 |
+
client = InferenceClient(token=HF_API_KEY)
|
19 |
|
20 |
response = client.text_generation("Hello!", model="Qwen/Qwen2.5-Coder-32B-Instruct")
|
21 |
print(response)
|