yxmauw commited on
Commit
a9c5062
1 Parent(s): a6327bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -7
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
- with gr.Row():
62
-
63
- input_text = gr.Textbox(lines=10, label="Input Text")
64
- output_text = gr.Textbox(lines=10, label="Generated Text")
 
 
 
 
 
 
 
 
65
 
66
- # Button to generate text
67
- generate_btn = gr.Button("Generate")
68
- generate_btn.click(fn=generate_text, inputs=[input_text, model_selection], outputs=output_text)
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()