Spaces:
Runtime error
Runtime error
Commit
·
89eae80
1
Parent(s):
166186b
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
import random
|
2 |
import gradio as gr
|
3 |
import bardapi
|
4 |
|
5 |
-
# Set your
|
6 |
-
token = '
|
7 |
|
8 |
-
def get_spaces_response(message
|
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.
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
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()
|