Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,17 +9,17 @@ def clear_memory(messages):
|
|
9 |
messages.clear()
|
10 |
return "Memory cleaned."
|
11 |
|
12 |
-
with gr.Blocks() as demo:
|
13 |
stored_message = gr.State([])
|
14 |
with gr.Row():
|
15 |
with gr.Column(scale=2):
|
16 |
text1 = gr.Textbox(lines=7, label="Prompt", scale=2)
|
17 |
with gr.Row():
|
18 |
-
btn1 = gr.Button("Submit",
|
19 |
-
btn2 = gr.Button("Clear",
|
20 |
-
btn3 = gr.Button("Clean Memory",
|
21 |
with gr.Column(scale=2):
|
22 |
-
out_text = gr.Text(lines=15, label="Output",
|
23 |
btn1.click(fn=greet, inputs=[text1, stored_message], outputs=out_text)
|
24 |
btn2.click(lambda: [None, None], outputs=[text1, out_text])
|
25 |
btn3.click(fn=clear_memory, inputs=[stored_message], outputs=[out_text])
|
|
|
9 |
messages.clear()
|
10 |
return "Memory cleaned."
|
11 |
|
12 |
+
with gr.Blocks(theme=gr.themes.Default(primary_hue=gr.themes.colors.orange, secondary_hue=gr.themes.colors.pink)) as demo:
|
13 |
stored_message = gr.State([])
|
14 |
with gr.Row():
|
15 |
with gr.Column(scale=2):
|
16 |
text1 = gr.Textbox(lines=7, label="Prompt", scale=2)
|
17 |
with gr.Row():
|
18 |
+
btn1 = gr.Button("Submit", scale=1)
|
19 |
+
btn2 = gr.Button("Clear", scale=1)
|
20 |
+
btn3 = gr.Button("Clean Memory", scale=2)
|
21 |
with gr.Column(scale=2):
|
22 |
+
out_text = gr.Text(lines=15, label="Output", scale=2)
|
23 |
btn1.click(fn=greet, inputs=[text1, stored_message], outputs=out_text)
|
24 |
btn2.click(lambda: [None, None], outputs=[text1, out_text])
|
25 |
btn3.click(fn=clear_memory, inputs=[stored_message], outputs=[out_text])
|