Commit
·
a06639e
1
Parent(s):
ea60d34
feat: Replace `update_button` with a gradio.Interface in the "Explore PapersWithCode Tasks" tab
Browse files
app.py
CHANGED
|
@@ -111,24 +111,23 @@ with gr.Blocks() as demo:
|
|
| 111 |
setup_repository_representations_tab(repos, representation_types)
|
| 112 |
with gr.Tab("Explore PapersWithCode Tasks"):
|
| 113 |
gr.Markdown("## PapersWithCode Tasks Visualization")
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
gr.
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
gr.
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
outputs=[all_repos_plot, selected_repos_plot],
|
| 132 |
)
|
| 133 |
|
| 134 |
demo.launch()
|
|
|
|
| 111 |
setup_repository_representations_tab(repos, representation_types)
|
| 112 |
with gr.Tab("Explore PapersWithCode Tasks"):
|
| 113 |
gr.Markdown("## PapersWithCode Tasks Visualization")
|
| 114 |
+
|
| 115 |
+
def update_plots(min_count):
|
| 116 |
+
all_plot, selected_plot = task_visualizations.display_tasks_sunburst_charts(min_count)
|
| 117 |
+
return [all_plot, selected_plot]
|
| 118 |
+
|
| 119 |
+
interface = gr.Interface(
|
| 120 |
+
fn=update_plots,
|
| 121 |
+
inputs=[
|
| 122 |
+
gr.Slider(minimum=1, maximum=100, value=10, step=1, label="Minimum Task Count")
|
| 123 |
+
],
|
| 124 |
+
outputs=[
|
| 125 |
+
gr.Plot(label="All Repositories"),
|
| 126 |
+
gr.Plot(label="Selected Repositories")
|
| 127 |
+
],
|
| 128 |
+
live=True,
|
| 129 |
+
title="PapersWithCode Tasks Visualization",
|
| 130 |
+
description="Adjust the minimum task count to update the sunburst charts."
|
|
|
|
| 131 |
)
|
| 132 |
|
| 133 |
demo.launch()
|