Update app.py
Browse files
app.py
CHANGED
@@ -4,20 +4,14 @@ import time
|
|
4 |
import random
|
5 |
import gradio as gr
|
6 |
from huggingface_hub import InferenceClient
|
7 |
-
from dotenv import load_dotenv
|
8 |
|
9 |
# Load environment variables from .env file
|
10 |
load_dotenv()
|
11 |
|
12 |
# Retrieve the Hugging Face API token from the environment
|
13 |
-
HF_TOKEN = os.environ.get("HF_TOKEN")
|
14 |
-
if not HF_TOKEN:
|
15 |
-
raise ValueError("Please set the HF_TOKEN environment variable in your .env file.")
|
16 |
-
|
17 |
# Initialize the InferenceClient (update the model as needed)
|
18 |
client = InferenceClient(
|
19 |
-
model="HuggingFaceH4/zephyr-7b-beta"
|
20 |
-
token=HF_TOKEN
|
21 |
)
|
22 |
|
23 |
# Optional: Enable scraping if your site is deployed.
|
|
|
4 |
import random
|
5 |
import gradio as gr
|
6 |
from huggingface_hub import InferenceClient
|
|
|
7 |
|
8 |
# Load environment variables from .env file
|
9 |
load_dotenv()
|
10 |
|
11 |
# Retrieve the Hugging Face API token from the environment
|
|
|
|
|
|
|
|
|
12 |
# Initialize the InferenceClient (update the model as needed)
|
13 |
client = InferenceClient(
|
14 |
+
model="HuggingFaceH4/zephyr-7b-beta" # Change to your model if needed
|
|
|
15 |
)
|
16 |
|
17 |
# Optional: Enable scraping if your site is deployed.
|