Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 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
|
| 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)
|