Update app.py
Browse files
app.py
CHANGED
@@ -79,12 +79,26 @@ def AIPatient(message):
|
|
79 |
return history
|
80 |
|
81 |
with gr.Blocks() as demo:
|
82 |
-
gr.
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
return history
|
80 |
|
81 |
with gr.Blocks() as demo:
|
82 |
+
gr.HTML("""<h1 align="center">So Rude</h1>""")
|
83 |
+
|
84 |
+
chatbot = gr.Chatbot()
|
85 |
+
with gr.Row():
|
86 |
+
with gr.Column(scale=4):
|
87 |
+
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=8, elem_id="user_input")
|
88 |
+
submitBtn = gr.Button("Submit", variant="primary", elem_id="submit_btn")
|
89 |
+
with gr.Column(scale=1):
|
90 |
+
max_length = gr.Slider(0, 256, value=64, step=1.0, label="Maximum Length", interactive=True)
|
91 |
+
top_p = gr.Slider(0, 1, value=0.7, step=0.01, label="Top P", interactive=True)
|
92 |
+
temperature = gr.Slider(0, 2.0, value=0.95, step=0.01, label="Temperature", interactive=True)
|
93 |
+
emptyBtn = gr.Button("Clear History")
|
94 |
+
|
95 |
+
history = gr.State([])
|
96 |
+
|
97 |
+
submitBtn.click(
|
98 |
+
predict, [user_input, chatbot, max_length, top_p, temperature, history], [chatbot, history], show_progress=True
|
99 |
+
)
|
100 |
+
submitBtn.click(reset_user_input, [], [user_input])
|
101 |
+
|
102 |
+
emptyBtn.click(reset_state, outputs=[chatbot, history], show_progress=True)
|
103 |
+
|
104 |
+
demo.queue().launch(share=False, inbrowser=True)
|