mimifuel2018 commited on
Commit
6112f4c
·
verified ·
1 Parent(s): 13b1549

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -1,9 +1,12 @@
1
  import gradio as gr
2
  import requests
 
3
 
4
- # Define the Hugging Face API endpoint and add your Hugging Face token
5
- api_url = "https://api-inference.huggingface.co/models/Qwen/Qwen2.5-72B-Instruct"
6
- headers = {"Authorization": "Bearer YOUR_HUGGINGFACE_TOKEN"} # Replace with your token
 
 
7
 
8
  # Define a function to send prompts to the model and get responses
9
  def query(prompt):
 
1
  import gradio as gr
2
  import requests
3
+ import os
4
 
5
+ # Define the Hugging Face API endpoint
6
+ api_url = "https://api-inference.huggingface.co/models/Qwen/Qwen-2.5-72B"
7
+
8
+ # Retrieve the token from the environment
9
+ headers = {"Authorization": f"Bearer {os.getenv('HF_TOKEN')}"}
10
 
11
  # Define a function to send prompts to the model and get responses
12
  def query(prompt):