Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -478,12 +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 |
-
# Buttons: Generate +
|
482 |
with gr.Row():
|
483 |
submit_button = gr.Button("Generate SCDD")
|
484 |
clear_button = gr.Button("Reset")
|
485 |
|
486 |
-
# Define interaction: When "Generate
|
487 |
submit_button.click(
|
488 |
fn=chatbot,
|
489 |
inputs=[
|
@@ -493,13 +493,27 @@ with gr.Blocks() as demo:
|
|
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 |
-
"",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
)
|
501 |
|
502 |
-
# Bind Clear Button
|
503 |
clear_button.click(
|
504 |
fn=clear_all,
|
505 |
inputs=[],
|
@@ -511,4 +525,4 @@ with gr.Blocks() as demo:
|
|
511 |
)
|
512 |
|
513 |
# Launch the app
|
514 |
-
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 + Reset
|
482 |
with gr.Row():
|
483 |
submit_button = gr.Button("Generate SCDD")
|
484 |
clear_button = gr.Button("Reset")
|
485 |
|
486 |
+
# Define interaction: When "Generate SCDD" 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 (Ensuring the correct number of outputs)
|
497 |
def clear_all():
|
498 |
return (
|
499 |
+
"", # user_input
|
500 |
+
"", # science_objectives_input
|
501 |
+
"", # context
|
502 |
+
"", # subdomain
|
503 |
+
False, # use_encoder
|
504 |
+
150, # max_tokens
|
505 |
+
0.7, # temperature
|
506 |
+
0.9, # top_p
|
507 |
+
0.5, # frequency_penalty
|
508 |
+
0.0, # presence_penalty
|
509 |
+
"", # full_response (textbox output)
|
510 |
+
None, # extracted_table_df (DataFrame output)
|
511 |
+
None, # word_doc_path (File output)
|
512 |
+
None, # iframe_html (HTML output)
|
513 |
+
None # mapify_button_html (HTML output)
|
514 |
)
|
515 |
|
516 |
+
# Bind Clear Button (Ensuring the correct number of outputs)
|
517 |
clear_button.click(
|
518 |
fn=clear_all,
|
519 |
inputs=[],
|
|
|
525 |
)
|
526 |
|
527 |
# Launch the app
|
528 |
+
demo.launch(share=True)
|