Spaces:
Runtime error
Runtime error
yjernite
commited on
Commit
·
eda017b
1
Parent(s):
0d44baa
fixed range for the dropdpwn
Browse files
app.py
CHANGED
|
@@ -121,6 +121,7 @@ def show_cluster(cl_id, num_clusters):
|
|
| 121 |
ethnicity_fig,
|
| 122 |
ethnicity_description,
|
| 123 |
images,
|
|
|
|
| 124 |
)
|
| 125 |
|
| 126 |
|
|
@@ -179,7 +180,7 @@ with gr.Blocks(title=TITLE) as demo:
|
|
| 179 |
demo.load(
|
| 180 |
fn=show_cluster,
|
| 181 |
inputs=[cluster_id, num_clusters],
|
| 182 |
-
outputs=[a, b, b_desc, c, c_desc, d, d_desc, gallery],
|
| 183 |
)
|
| 184 |
num_clusters.change(
|
| 185 |
fn=show_cluster,
|
|
@@ -193,12 +194,13 @@ with gr.Blocks(title=TITLE) as demo:
|
|
| 193 |
d,
|
| 194 |
d_desc,
|
| 195 |
gallery,
|
|
|
|
| 196 |
],
|
| 197 |
)
|
| 198 |
cluster_id.change(
|
| 199 |
fn=show_cluster,
|
| 200 |
inputs=[cluster_id, num_clusters],
|
| 201 |
-
outputs=[a, b, b_desc, c, c_desc, d, d_desc, gallery],
|
| 202 |
)
|
| 203 |
|
| 204 |
if __name__ == "__main__":
|
|
|
|
| 121 |
ethnicity_fig,
|
| 122 |
ethnicity_description,
|
| 123 |
images,
|
| 124 |
+
gr.update(choices=[i for i in range(num_clusters)]),
|
| 125 |
)
|
| 126 |
|
| 127 |
|
|
|
|
| 180 |
demo.load(
|
| 181 |
fn=show_cluster,
|
| 182 |
inputs=[cluster_id, num_clusters],
|
| 183 |
+
outputs=[a, b, b_desc, c, c_desc, d, d_desc, gallery, cluster_id],
|
| 184 |
)
|
| 185 |
num_clusters.change(
|
| 186 |
fn=show_cluster,
|
|
|
|
| 194 |
d,
|
| 195 |
d_desc,
|
| 196 |
gallery,
|
| 197 |
+
cluster_id,
|
| 198 |
],
|
| 199 |
)
|
| 200 |
cluster_id.change(
|
| 201 |
fn=show_cluster,
|
| 202 |
inputs=[cluster_id, num_clusters],
|
| 203 |
+
outputs=[a, b, b_desc, c, c_desc, d, d_desc, gallery, cluster_id],
|
| 204 |
)
|
| 205 |
|
| 206 |
if __name__ == "__main__":
|