Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
|
|
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Function to chat with the bot
|
| 8 |
def chat_with_bot(user_input, history=[]):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
+
# Fetch the token from the environment variable
|
| 6 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 7 |
+
|
| 8 |
+
# Initialize the Inference API client with the secret token
|
| 9 |
+
client = InferenceClient(token=hf_token)
|
| 10 |
|
| 11 |
# Function to chat with the bot
|
| 12 |
def chat_with_bot(user_input, history=[]):
|