azazel1805 commited on
Commit
926bd72
·
verified ·
1 Parent(s): 6c5a375

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -1,8 +1,12 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
 
3
 
4
- # Initialize the Inference API client
5
- client = InferenceClient(token="your-hf-token") # Replace with your token from Settings > Access Tokens
 
 
 
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=[]):