Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,11 @@ from huggingface_hub import InferenceClient
|
|
| 5 |
"""
|
| 6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 7 |
"""
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
@spaces.GPU(duration=60)
|
| 11 |
def respond(
|
|
|
|
| 5 |
"""
|
| 6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 7 |
"""
|
| 8 |
+
token = os.getenv("HUGGINGFACE_TOKEN")
|
| 9 |
+
if token =="":
|
| 10 |
+
raise ValueError("HUGGINGFACE_TOKEN environment variable is not set")
|
| 11 |
+
|
| 12 |
+
client = InferenceClient("google/gemma-2-2b",token = token)
|
| 13 |
|
| 14 |
@spaces.GPU(duration=60)
|
| 15 |
def respond(
|