Tolulope Ogunremi commited on
Commit
d73c68d
·
1 Parent(s): 135bef5

changing dropdown phones

Browse files
Files changed (1) hide show
  1. app.py +7 -32
app.py CHANGED
@@ -112,6 +112,7 @@ def load_analyzer_for_subdir(subdir_path):
112
  return MultiModelAnalyzer(str(subdir_path))
113
 
114
 
 
115
  def create_integrated_gradio_interface(analyzer: MultiModelAnalyzer):
116
  """
117
  Create comprehensive Gradio interface with model comparison.
@@ -131,9 +132,8 @@ def create_integrated_gradio_interface(analyzer: MultiModelAnalyzer):
131
 
132
  model_names = analyzer.get_model_names()
133
 
134
- with gr.Column() as demo:
135
-
136
- gr.Markdown("Discrete Token Phoneme Analysis")
137
  # gr.Markdown("Compare HuBERT models and analyze discrete representations")
138
 
139
  with gr.Tabs():
@@ -158,10 +158,10 @@ def create_integrated_gradio_interface(analyzer: MultiModelAnalyzer):
158
  )
159
 
160
  # Initialize
161
- # refresh_comparison_btn.click(
162
- # fn=update_comparison,
163
- # outputs=[comparison_plot, metrics_table]
164
- # )
165
 
166
  # Tab 2: Single Model Analysis
167
  """
@@ -1019,31 +1019,6 @@ def create_integrated_gradio_interface(analyzer: MultiModelAnalyzer):
1019
 
1020
  return demo
1021
 
1022
-
1023
- def create_root_interface(output_dir):
1024
- subdirs = get_top_level_dirs(output_dir)
1025
-
1026
- # Load config
1027
- try:
1028
- with open("config.json") as f:
1029
- config = json.load(f)
1030
- selected = config.get("selected_dirs", [])
1031
- if selected:
1032
- subdirs = [d for d in subdirs if d.name in selected]
1033
- except FileNotFoundError:
1034
- pass # Load all if no config
1035
-
1036
- with gr.Blocks() as demo:
1037
- gr.Markdown("## Discrete Token Phoneme Analysis")
1038
-
1039
- with gr.Tabs():
1040
- for subdir in subdirs:
1041
- with gr.Tab(subdir.name):
1042
- analyzer = load_analyzer_for_subdir(subdir)
1043
- create_integrated_gradio_interface(analyzer)
1044
-
1045
- return demo
1046
-
1047
  if __name__ == "__main__":
1048
  # # Create analyzer
1049
  # analyzer = MultiModelAnalyzer(OUTPUT_DIR)
 
112
  return MultiModelAnalyzer(str(subdir_path))
113
 
114
 
115
+
116
  def create_integrated_gradio_interface(analyzer: MultiModelAnalyzer):
117
  """
118
  Create comprehensive Gradio interface with model comparison.
 
132
 
133
  model_names = analyzer.get_model_names()
134
 
135
+ with gr.Blocks(title="Discrete Token Analysis", theme=gr.themes.Soft()) as demo:
136
+ gr.Markdown("#Discrete Token Phoneme Analysis")
 
137
  # gr.Markdown("Compare HuBERT models and analyze discrete representations")
138
 
139
  with gr.Tabs():
 
158
  )
159
 
160
  # Initialize
161
+ demo.load(
162
+ fn=update_comparison,
163
+ outputs=[comparison_plot, metrics_table]
164
+ )
165
 
166
  # Tab 2: Single Model Analysis
167
  """
 
1019
 
1020
  return demo
1021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1022
  if __name__ == "__main__":
1023
  # # Create analyzer
1024
  # analyzer = MultiModelAnalyzer(OUTPUT_DIR)