CultriX commited on
Commit
7b7eb30
·
verified ·
1 Parent(s): 03bdf6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -19,7 +19,7 @@ def parse_data(file_content):
19
  if line.startswith('hf (pretrained='):
20
  current_model = line.split('pretrained=')[1].split(',')[0]
21
  elif line and current_model:
22
- if not line.startswith('-') and '|' in line:
23
  # Parse table row
24
  parts = [p.strip() for p in line.split('|')]
25
  if len(parts) >= 2: # Ensure the correct number of columns
@@ -191,11 +191,11 @@ if __name__ == "__main__":
191
  with gr.Row():
192
  plotly_avg = gr.HTML(label="Plotly Average Performance Chart")
193
 
194
- task_tabs = gr.TabbedInterface(
195
- [])
196
  def update_tabs(file_content):
197
  _, _, _, _, _, _, plotly_tasks = process_and_visualize(file_content)
198
- return [gr.HTML(value=html) for html in plotly_tasks.values()]
199
 
200
  input_text.change(
201
  fn=process_and_visualize,
@@ -204,6 +204,5 @@ if __name__ == "__main__":
204
  )
205
 
206
  input_text.change(fn=update_tabs, inputs=input_text, outputs=[task_tabs])
207
-
208
-
209
  demo.launch(share=True)
 
19
  if line.startswith('hf (pretrained='):
20
  current_model = line.split('pretrained=')[1].split(',')[0]
21
  elif line and current_model:
22
+ if '|' in line:
23
  # Parse table row
24
  parts = [p.strip() for p in line.split('|')]
25
  if len(parts) >= 2: # Ensure the correct number of columns
 
191
  with gr.Row():
192
  plotly_avg = gr.HTML(label="Plotly Average Performance Chart")
193
 
194
+ task_tabs = gr.TabbedInterface([])
195
+
196
  def update_tabs(file_content):
197
  _, _, _, _, _, _, plotly_tasks = process_and_visualize(file_content)
198
+ return [gr.HTML(value=html, label=task) for task, html in plotly_tasks.items()]
199
 
200
  input_text.change(
201
  fn=process_and_visualize,
 
204
  )
205
 
206
  input_text.change(fn=update_tabs, inputs=input_text, outputs=[task_tabs])
207
+
 
208
  demo.launch(share=True)