Update app.py
Browse files
app.py
CHANGED
@@ -58,13 +58,21 @@ with gr.Blocks() as demo:
|
|
58 |
# Link the dropdown with the textbox to update the description based on the selected model
|
59 |
model_selection.change(fn=llm_intro, inputs=model_selection, outputs=explanation)
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
|
70 |
demo.launch()
|
|
|
58 |
# Link the dropdown with the textbox to update the description based on the selected model
|
59 |
model_selection.change(fn=llm_intro, inputs=model_selection, outputs=explanation)
|
60 |
|
61 |
+
chatbot = gr.Chatbot()
|
62 |
+
input_text = gr.Textbox(lines=10, label="Input Text")
|
63 |
+
# output_text = gr.Textbox(lines=10, label="Generated Text")
|
64 |
+
clear = gr.ClearButton([input_text, chatbot])
|
65 |
+
|
66 |
+
def respond(message, chat_history):
|
67 |
+
bot_reply = gr.Textbox(lines=10, label="Generated Text")
|
68 |
+
chat_history.append((message, bot_reply))
|
69 |
+
time.sleep(2)
|
70 |
+
return "", chat_history
|
71 |
+
|
72 |
+
input_text.submit(respond, [input_text, chatbot], [input_text, chatbot])
|
73 |
|
74 |
+
# # Button to generate text
|
75 |
+
# generate_btn = gr.Button("Generate")
|
76 |
+
# generate_btn.click(fn=generate_text, inputs=[input_text, model_selection], outputs=output_text)
|
77 |
|
78 |
demo.launch()
|