Spaces:
Sleeping
Sleeping
Commit ·
a7af00e
1
Parent(s): f41839a
fixes
Browse files
app.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 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
|
|
@@ -12,6 +16,8 @@ if not HF_TOKEN:
|
|
| 12 |
print("Warning: No Hugging Face token found in environment variables.")
|
| 13 |
print("Please set your HF_TOKEN environment variable or add it directly in the code.")
|
| 14 |
print("Get your token from: https://huggingface.co/settings/tokens")
|
|
|
|
|
|
|
| 15 |
|
| 16 |
client = InferenceClient(
|
| 17 |
"Trinoid/Data_Management_Mistral",
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
import os
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
+
|
| 6 |
+
# Load environment variables from .env file
|
| 7 |
+
load_dotenv()
|
| 8 |
|
| 9 |
"""
|
| 10 |
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
|
|
|
|
| 16 |
print("Warning: No Hugging Face token found in environment variables.")
|
| 17 |
print("Please set your HF_TOKEN environment variable or add it directly in the code.")
|
| 18 |
print("Get your token from: https://huggingface.co/settings/tokens")
|
| 19 |
+
else:
|
| 20 |
+
print("HF_TOKEN found in environment variables!")
|
| 21 |
|
| 22 |
client = InferenceClient(
|
| 23 |
"Trinoid/Data_Management_Mistral",
|