Spaces:
Runtime error
Runtime error
Commit
·
02fae49
1
Parent(s):
89eae80
Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
import bardapi
|
3 |
|
4 |
-
# Set your
|
5 |
-
token = '
|
6 |
|
7 |
-
def
|
8 |
-
# Send an API request and get a response
|
9 |
-
response = bardapi.core.Bard(token).get_answer(
|
10 |
-
return response
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
description="Chat with a Hugging Face Spaces model",
|
18 |
-
layout="vertical",
|
19 |
-
)
|
20 |
|
21 |
-
|
22 |
-
|
|
|
1 |
import gradio as gr
|
2 |
import bardapi
|
3 |
|
4 |
+
# Set your Secure-1PSID value to key
|
5 |
+
token = 'cQjDrFOQjkhOHHHCW54Tc7IKyphnqos-A-IpmgjVa9p3_ZFFa5Ilet-heMO8Xm3TM1Y5vw'
|
6 |
|
7 |
+
def get_answer(input_text):
|
8 |
+
# Send an API request and get a response.
|
9 |
+
response = bardapi.core.Bard(token).get_answer(input_text)
|
10 |
+
return response
|
11 |
|
12 |
+
# Create a Gradio interface
|
13 |
+
iface = gr.Interface(
|
14 |
+
fn=get_answer,
|
15 |
+
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your input text"),
|
16 |
+
outputs="text")
|
|
|
|
|
|
|
17 |
|
18 |
+
# Run the interface
|
19 |
+
iface.launch()
|