aquibmoin commited on
Commit
9a77a66
·
verified ·
1 Parent(s): 33d1fed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -4
app.py CHANGED
@@ -478,10 +478,12 @@ with gr.Blocks() as demo:
478
  iframe_html = gr.HTML(label="Miro")
479
  mapify_button_html = gr.HTML(label="Generate Mind Map on Mapify")
480
 
481
- # Launch Button
482
- submit_button = gr.Button("Generate Science Case")
483
-
484
- # Define interaction: When the button is clicked, it triggers `chatbot`
 
 
485
  submit_button.click(
486
  fn=chatbot,
487
  inputs=[
@@ -491,5 +493,22 @@ with gr.Blocks() as demo:
491
  outputs=[full_response, extracted_table_df, word_doc_path, iframe_html, mapify_button_html]
492
  )
493
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
  # Launch the app
495
  demo.launch(share=True)
 
478
  iframe_html = gr.HTML(label="Miro")
479
  mapify_button_html = gr.HTML(label="Generate Mind Map on Mapify")
480
 
481
+ # Buttons: Generate + Clear
482
+ with gr.Row():
483
+ submit_button = gr.Button("Generate SCDD")
484
+ clear_button = gr.Button("Reset")
485
+
486
+ # Define interaction: When "Generate Science Case" is clicked
487
  submit_button.click(
488
  fn=chatbot,
489
  inputs=[
 
493
  outputs=[full_response, extracted_table_df, word_doc_path, iframe_html, mapify_button_html]
494
  )
495
 
496
+ # 🚀 Define Clear Function
497
+ def clear_all():
498
+ return (
499
+ "", "", "", "", False, 150, 0.7, 0.9, 0.5, 0.0, "", None, None, None, None
500
+ )
501
+
502
+ # Bind Clear Button
503
+ clear_button.click(
504
+ fn=clear_all,
505
+ inputs=[],
506
+ outputs=[
507
+ user_input, science_objectives_input, context, subdomain,
508
+ use_encoder, max_tokens, temperature, top_p, frequency_penalty, presence_penalty,
509
+ full_response, extracted_table_df, word_doc_path, iframe_html, mapify_button_html
510
+ ]
511
+ )
512
+
513
  # Launch the app
514
  demo.launch(share=True)