Kvikontent commited on
Commit
89eae80
·
1 Parent(s): 166186b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -1,22 +1,22 @@
1
- import random
2
  import gradio as gr
3
  import bardapi
4
 
5
- # Set your Secure-1PSID value to token
6
- token = 'cQjDrFOQjkhOHHHCW54Tc7IKyphnqos-A-IpmgjVa9p3_ZFFa5Ilet-heMO8Xm3TM1Y5vw.'
7
 
8
- def get_spaces_response(message, history):
9
  # Send an API request and get a response
10
  response = bardapi.core.Bard(token).get_answer(message)
11
  return response["answers"][0]["answer"]
12
 
13
- chatbot = gr.ChatInterface(fn=get_spaces_response,
14
- inputs="text",
15
- outputs="text",
16
- title="Hugging Face Spaces Chat",
17
- description="Chat with a Hugging Face Spaces model",
18
- placeholder="Type your message here..."
19
- )
 
20
 
21
  if __name__ == "__main__":
22
- chatbot.launch()
 
 
1
  import gradio as gr
2
  import bardapi
3
 
4
+ # Set your token
5
+ token = 'xxxxxxx'
6
 
7
+ def get_spaces_response(message):
8
  # Send an API request and get a response
9
  response = bardapi.core.Bard(token).get_answer(message)
10
  return response["answers"][0]["answer"]
11
 
12
+ chatbot = gr.Interface(
13
+ fn=get_spaces_response,
14
+ inputs="text",
15
+ outputs="text",
16
+ title="Hugging Face Spaces Chat",
17
+ description="Chat with a Hugging Face Spaces model",
18
+ layout="vertical",
19
+ )
20
 
21
  if __name__ == "__main__":
22
+ chatbot.launch()