Spaces:
Sleeping
Sleeping
Commit
·
9389450
1
Parent(s):
24c5da9
feat: add error if env var is missing
Browse files
app.py
CHANGED
|
@@ -7,6 +7,9 @@ load_dotenv()
|
|
| 7 |
|
| 8 |
token = os.environ.get("HF_TOKEN")
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
"""
|
| 11 |
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
|
| 12 |
"""
|
|
|
|
| 7 |
|
| 8 |
token = os.environ.get("HF_TOKEN")
|
| 9 |
|
| 10 |
+
if not token:
|
| 11 |
+
raise gr.Error("HF_TOKEN is not set.")
|
| 12 |
+
|
| 13 |
"""
|
| 14 |
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
|
| 15 |
"""
|