Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
|
|
|
|
|
|
|
|
|
|
|
4 |
with gr.Blocks() as demo:
|
5 |
overview = gr.Markdown("""
|
6 |
# CentaurSock
|
@@ -12,27 +17,31 @@ with gr.Blocks() as demo:
|
|
12 |
---
|
13 |
""")
|
14 |
|
|
|
|
|
|
|
|
|
|
|
15 |
with gr.Row():
|
16 |
ally_title = gr.Markdown("""<center><h2> ALLY </h2></center>""")
|
17 |
gatekeeper_title = gr.Markdown("""<center><h2> GATEKEEPER </h2></center>""")
|
18 |
-
|
|
|
19 |
with gr.Row():
|
20 |
img1 = gr.Markdown("""""")
|
21 |
img2 = gr.Markdown("""""")
|
22 |
|
|
|
23 |
with gr.Row():
|
24 |
chatbot1 = gr.Chatbot(label='Ally Chat')
|
25 |
chatbot2 = gr.Chatbot(label='Gatekeeper Chat')
|
26 |
|
|
|
27 |
with gr.Row():
|
28 |
textbox1 = gr.Textbox(label='Ally')
|
29 |
textbox2 = gr.Textbox(label='Gatekeeper')
|
30 |
|
31 |
-
|
32 |
-
bot_message = 'echo ' + message
|
33 |
-
chat_history.append((message, bot_message))
|
34 |
-
return '', chat_history
|
35 |
-
|
36 |
textbox1.submit(echo, [textbox1, chatbot1], [textbox1, chatbot1])
|
37 |
textbox2.submit(echo, [textbox2, chatbot2], [textbox2, chatbot2])
|
38 |
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
|
4 |
+
def echo(message, chat_history):
|
5 |
+
bot_message = 'echo ' + message
|
6 |
+
chat_history.append((message, bot_message))
|
7 |
+
return '', chat_history
|
8 |
+
|
9 |
with gr.Blocks() as demo:
|
10 |
overview = gr.Markdown("""
|
11 |
# CentaurSock
|
|
|
17 |
---
|
18 |
""")
|
19 |
|
20 |
+
# OpenAI key
|
21 |
+
openai_key_textbox = gr.Textbox(label='OpenAI Key')
|
22 |
+
openai_key_button = gr.Textbox(label='Test OpenAI Key')
|
23 |
+
|
24 |
+
# Titles
|
25 |
with gr.Row():
|
26 |
ally_title = gr.Markdown("""<center><h2> ALLY </h2></center>""")
|
27 |
gatekeeper_title = gr.Markdown("""<center><h2> GATEKEEPER </h2></center>""")
|
28 |
+
|
29 |
+
# Images of ally and gatekeeper
|
30 |
with gr.Row():
|
31 |
img1 = gr.Markdown("""""")
|
32 |
img2 = gr.Markdown("""""")
|
33 |
|
34 |
+
# Chatbots
|
35 |
with gr.Row():
|
36 |
chatbot1 = gr.Chatbot(label='Ally Chat')
|
37 |
chatbot2 = gr.Chatbot(label='Gatekeeper Chat')
|
38 |
|
39 |
+
# Input textboxes
|
40 |
with gr.Row():
|
41 |
textbox1 = gr.Textbox(label='Ally')
|
42 |
textbox2 = gr.Textbox(label='Gatekeeper')
|
43 |
|
44 |
+
# Inpit textbox event handlers
|
|
|
|
|
|
|
|
|
45 |
textbox1.submit(echo, [textbox1, chatbot1], [textbox1, chatbot1])
|
46 |
textbox2.submit(echo, [textbox2, chatbot2], [textbox2, chatbot2])
|
47 |
|