wi-lab commited on
Commit
7dbc6c5
·
verified ·
1 Parent(s): 254eeb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -657,9 +657,9 @@ with gr.Blocks(css="""
657
  embeddings_img_los = gr.Image(label="Embeddings", type="pil", width=300, height=300)
658
  output_textbox = gr.Textbox(label="Console Output", lines=10, elem_id="console-output")
659
 
660
- emb_type = gr.Dropdown(choices=["Channel Embedding", "CLS Embedding"],
661
- value="CLS Embedding",
662
- label="Embedding Type", interactive=True)
663
 
664
  # Update the file uploader visibility based on user choice
665
  #def toggle_file_input(choice):
@@ -677,9 +677,14 @@ with gr.Blocks(css="""
677
  inputs=[choice_radio],
678
  outputs=[file_input, emb_type])
679
 
 
 
 
 
 
680
  # When user makes a choice, update the display
681
- choice_radio.change(fn=handle_user_choice, inputs=[choice_radio, percentage_slider_los, file_input, emb_type],
682
- outputs=[raw_img_los, embeddings_img_los, output_textbox])
683
 
684
  # When percentage slider changes (for predefined data)
685
  percentage_slider_los.change(fn=handle_user_choice, inputs=[choice_radio, percentage_slider_los, file_input, emb_type],
 
657
  embeddings_img_los = gr.Image(label="Embeddings", type="pil", width=300, height=300)
658
  output_textbox = gr.Textbox(label="Console Output", lines=10, elem_id="console-output")
659
 
660
+ #emb_type = gr.Dropdown(choices=["Channel Embedding", "CLS Embedding"],
661
+ # value="CLS Embedding",
662
+ # label="Embedding Type", interactive=True)
663
 
664
  # Update the file uploader visibility based on user choice
665
  #def toggle_file_input(choice):
 
677
  inputs=[choice_radio],
678
  outputs=[file_input, emb_type])
679
 
680
+ # Layout for the UI
681
+ with gr.Row():
682
+ file_input.render() # File input will be hidden initially
683
+ emb_type.render() # Embedding type dropdown will be hidden initially
684
+
685
  # When user makes a choice, update the display
686
+ #choice_radio.change(fn=handle_user_choice, inputs=[choice_radio, percentage_slider_los, file_input, emb_type],
687
+ # outputs=[raw_img_los, embeddings_img_los, output_textbox])
688
 
689
  # When percentage slider changes (for predefined data)
690
  percentage_slider_los.change(fn=handle_user_choice, inputs=[choice_radio, percentage_slider_los, file_input, emb_type],