peterciank commited on
Commit
a6212b3
·
verified ·
1 Parent(s): 8262b1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -5,18 +5,15 @@ import requests
5
 
6
  # Set up Hugging Face API details
7
  token=os.getenv("HF_TOKEN", None)
8
- st.write(token)
9
 
10
-
11
-
12
- '''
13
- ###################################################
14
  headers = {"Authorization": f"Bearer {token}"}
15
  API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn"
 
16
  # Function to query the Hugging Face model
17
  def query(payload):
18
  response = requests.post(API_URL, headers=headers, json=payload)
19
  return response.json()
 
20
  # Streamlit UI
21
  st.title("Chat App with Hugging Face")
22
  user_input = st.text_input("You:", "")
@@ -30,4 +27,3 @@ if st.button("Send"):
30
  st.text_area("Bot:", value=data[0]["summary_text"], height=150)
31
  else:
32
  st.error("No response from the model")
33
- '''
 
5
 
6
  # Set up Hugging Face API details
7
  token=os.getenv("HF_TOKEN", None)
 
8
 
 
 
 
 
9
  headers = {"Authorization": f"Bearer {token}"}
10
  API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-cnn"
11
+
12
  # Function to query the Hugging Face model
13
  def query(payload):
14
  response = requests.post(API_URL, headers=headers, json=payload)
15
  return response.json()
16
+
17
  # Streamlit UI
18
  st.title("Chat App with Hugging Face")
19
  user_input = st.text_input("You:", "")
 
27
  st.text_area("Bot:", value=data[0]["summary_text"], height=150)
28
  else:
29
  st.error("No response from the model")