Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -634,7 +634,6 @@ with gr.Blocks(css="""
|
|
634 |
</ul>
|
635 |
</div>
|
636 |
""")
|
637 |
-
|
638 |
# Radio button for user choice: predefined data or upload dataset
|
639 |
choice_radio = gr.Radio(choices=["Use Default Dataset", "Upload Dataset"],
|
640 |
label="Choose how to proceed",
|
@@ -667,24 +666,20 @@ with gr.Blocks(css="""
|
|
667 |
visible = (choice == "Upload Dataset")
|
668 |
return gr.update(visible=visible), gr.update(visible=visible)
|
669 |
|
670 |
-
# Change visibility of file input and embedding type dropdown based on
|
671 |
choice_radio.change(fn=toggle_file_input_and_emb_type,
|
672 |
inputs=[choice_radio],
|
673 |
outputs=[file_input, emb_type])
|
674 |
|
675 |
-
# Layout for the UI
|
676 |
-
with gr.Row():
|
677 |
-
file_input.render() # File input will be hidden initially
|
678 |
-
emb_type.render() # Embedding type dropdown will be hidden initially
|
679 |
-
|
680 |
# When percentage slider changes (for predefined data)
|
681 |
percentage_slider_los.change(fn=handle_user_choice,
|
682 |
inputs=[choice_radio, percentage_slider_los, file_input, emb_type],
|
683 |
outputs=[raw_img_los, embeddings_img_los, output_textbox])
|
684 |
-
|
685 |
-
#
|
686 |
-
|
687 |
-
|
|
|
688 |
|
689 |
# Add a conclusion section at the bottom
|
690 |
gr.Markdown("""
|
|
|
634 |
</ul>
|
635 |
</div>
|
636 |
""")
|
|
|
637 |
# Radio button for user choice: predefined data or upload dataset
|
638 |
choice_radio = gr.Radio(choices=["Use Default Dataset", "Upload Dataset"],
|
639 |
label="Choose how to proceed",
|
|
|
666 |
visible = (choice == "Upload Dataset")
|
667 |
return gr.update(visible=visible), gr.update(visible=visible)
|
668 |
|
669 |
+
# Change visibility of file input and embedding type dropdown based on choice
|
670 |
choice_radio.change(fn=toggle_file_input_and_emb_type,
|
671 |
inputs=[choice_radio],
|
672 |
outputs=[file_input, emb_type])
|
673 |
|
|
|
|
|
|
|
|
|
|
|
674 |
# When percentage slider changes (for predefined data)
|
675 |
percentage_slider_los.change(fn=handle_user_choice,
|
676 |
inputs=[choice_radio, percentage_slider_los, file_input, emb_type],
|
677 |
outputs=[raw_img_los, embeddings_img_los, output_textbox])
|
678 |
+
|
679 |
+
# Layout for the UI - this part does NOT need .render(), Gradio will render these automatically
|
680 |
+
with gr.Row():
|
681 |
+
file_input # No need for .render()
|
682 |
+
emb_type # No need for .render()
|
683 |
|
684 |
# Add a conclusion section at the bottom
|
685 |
gr.Markdown("""
|