yetessam commited on
Commit
e43d00f
·
verified ·
1 Parent(s): 58013ba

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +13 -1
Gradio_UI.py CHANGED
@@ -342,6 +342,7 @@ class GradioUI:
342
  [upload_status, file_uploads_log],
343
  )
344
  text_input = gr.Textbox(lines=1, label="Chat Message")
 
345
  text_input.submit(
346
  self.log_user_message,
347
  text_input,
@@ -349,12 +350,23 @@ class GradioUI:
349
  # outputs
350
  [stored_messages, text_input],
351
  ).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
352
-
353
  gr.Examples(
354
  examples=get_examples(),
355
  inputs=text_input,
356
  label="Example Input Text"
357
  )
 
 
 
 
 
 
 
 
 
 
 
358
  gr.Markdown( agent_footer )
359
 
360
  demo.launch(debug=True, share=True, **kwargs)
 
342
  [upload_status, file_uploads_log],
343
  )
344
  text_input = gr.Textbox(lines=1, label="Chat Message")
345
+ '''
346
  text_input.submit(
347
  self.log_user_message,
348
  text_input,
 
350
  # outputs
351
  [stored_messages, text_input],
352
  ).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
353
+ '''
354
  gr.Examples(
355
  examples=get_examples(),
356
  inputs=text_input,
357
  label="Example Input Text"
358
  )
359
+ # Example texts (you can replace these with your own examples)
360
+ example_texts = ["Example 1: Hello!", "Example 2: How are you?", "Example 3: What's your name?"]
361
+
362
+ # Set up the examples, with the on_example_click to update text_input
363
+ gr.Examples(
364
+ examples=example_texts,
365
+ inputs=text_input,
366
+ label="Demoing Text",
367
+ fn=on_example_click # Update text_input with the selected example
368
+ )
369
+
370
  gr.Markdown( agent_footer )
371
 
372
  demo.launch(debug=True, share=True, **kwargs)