Sadjad Alikhani commited on
Commit
7e7ba0a
·
verified ·
1 Parent(s): bd80b61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -28,11 +28,10 @@ with gr.Blocks() as demo:
28
  gr.Markdown("# Raw vs. Embeddings Inference Results")
29
  gr.Markdown("Select a data percentage and task complexity to view the corresponding inference result for raw channels and embeddings.")
30
 
31
- # Add scrollable area for configurations
32
- with gr.Scroll(height=150): # Scrollable area for the configurations
33
- with gr.Row():
34
- percentage_dropdown = gr.Dropdown(data_percentage_options, label="Percentage of Data for Training", value=10)
35
- complexity_radio = gr.Radio(task_complexity_options, label="Task Complexity", value=16)
36
 
37
  # Outputs (display the images side by side and set a smaller size for the images)
38
  with gr.Row():
@@ -43,6 +42,14 @@ with gr.Blocks() as demo:
43
  percentage_dropdown.change(fn=display_images, inputs=[percentage_dropdown, complexity_radio], outputs=[raw_img, embeddings_img])
44
  complexity_radio.change(fn=display_images, inputs=[percentage_dropdown, complexity_radio], outputs=[raw_img, embeddings_img])
45
 
 
 
 
 
 
 
 
 
46
  # Launch the app
47
  if __name__ == "__main__":
48
  demo.launch()
 
28
  gr.Markdown("# Raw vs. Embeddings Inference Results")
29
  gr.Markdown("Select a data percentage and task complexity to view the corresponding inference result for raw channels and embeddings.")
30
 
31
+ # Add scrollable area for configurations (using CSS)
32
+ with gr.Column(elem_id="scrollable-configs"): # Add custom CSS for scrollable behavior
33
+ percentage_dropdown = gr.Dropdown(data_percentage_options, label="Percentage of Data for Training", value=10)
34
+ complexity_radio = gr.Radio(task_complexity_options, label="Task Complexity", value=16)
 
35
 
36
  # Outputs (display the images side by side and set a smaller size for the images)
37
  with gr.Row():
 
42
  percentage_dropdown.change(fn=display_images, inputs=[percentage_dropdown, complexity_radio], outputs=[raw_img, embeddings_img])
43
  complexity_radio.change(fn=display_images, inputs=[percentage_dropdown, complexity_radio], outputs=[raw_img, embeddings_img])
44
 
45
+ # Add custom CSS for scrollable area
46
+ demo.css = """
47
+ #scrollable-configs {
48
+ max-height: 150px;
49
+ overflow-y: auto;
50
+ }
51
+ """
52
+
53
  # Launch the app
54
  if __name__ == "__main__":
55
  demo.launch()