lovodkin93 commited on
Commit
cbee98e
·
verified ·
1 Parent(s): c09fda7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -12,15 +12,21 @@ def show_html_in_iframe(page_idx, curr_split):
12
  # Example lists of HTML files for 'test' and 'dev' instances
13
  train_html_files = [f for f in os.listdir(os.path.join("html_files", "train")) if f.endswith('.html')]
14
  dev_html_files = [f for f in os.listdir(os.path.join("html_files", "dev")) if f.endswith('.html')]
 
15
 
16
  # Function to return the appropriate list based on instance type
17
  def get_html_files_list(instance_type):
18
- return train_html_files if instance_type == 'train' else dev_html_files
 
 
 
 
 
19
 
20
 
21
  with gr.Blocks() as demo:
22
  with gr.Row():
23
- instance_type_dropdown = gr.Dropdown(choices=['train', 'dev'], label='Instance Type')
24
  slider = gr.Slider(minimum=0, step=1, label='Data Instance')
25
 
26
  # Dynamic update of slider based on instance type
 
12
  # Example lists of HTML files for 'test' and 'dev' instances
13
  train_html_files = [f for f in os.listdir(os.path.join("html_files", "train")) if f.endswith('.html')]
14
  dev_html_files = [f for f in os.listdir(os.path.join("html_files", "dev")) if f.endswith('.html')]
15
+ test_html_files = [f for f in os.listdir(os.path.join("html_files", "test")) if f.endswith('.html')]
16
 
17
  # Function to return the appropriate list based on instance type
18
  def get_html_files_list(instance_type):
19
+ if instance_type == 'train':
20
+ return train_html_files
21
+ elif instance_type == 'dev':
22
+ return dev_html_files
23
+ elif instance_type == 'test':
24
+ return test_html_files
25
 
26
 
27
  with gr.Blocks() as demo:
28
  with gr.Row():
29
+ instance_type_dropdown = gr.Dropdown(choices=['train', 'dev', 'test'], label='Instance Type')
30
  slider = gr.Slider(minimum=0, step=1, label='Data Instance')
31
 
32
  # Dynamic update of slider based on instance type