Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -989,7 +989,7 @@ def get_query_list():
|
|
| 989 |
"""Get list of unique queries with truncated display labels."""
|
| 990 |
df = current_data["df"]
|
| 991 |
if df.empty or 'query' not in df.columns:
|
| 992 |
-
return gr.
|
| 993 |
|
| 994 |
queries = df['query'].unique().tolist()
|
| 995 |
# Return tuples of (truncated_label, full_value) for dropdown
|
|
@@ -1003,7 +1003,7 @@ def get_query_list():
|
|
| 1003 |
label = f"[{i+1}] {q_str}"
|
| 1004 |
truncated_queries.append((label, q_str))
|
| 1005 |
|
| 1006 |
-
return gr.
|
| 1007 |
|
| 1008 |
|
| 1009 |
def refresh_all():
|
|
@@ -1177,7 +1177,7 @@ with demo_context as demo:
|
|
| 1177 |
fn=refresh_all,
|
| 1178 |
outputs=[stats_html, stats_chart, graph_plot, embed_plot, circuit_html, circuit_chart]
|
| 1179 |
).then(
|
| 1180 |
-
fn=lambda: gr.
|
| 1181 |
outputs=[token_slider]
|
| 1182 |
).then(
|
| 1183 |
fn=get_query_list,
|
|
|
|
| 989 |
"""Get list of unique queries with truncated display labels."""
|
| 990 |
df = current_data["df"]
|
| 991 |
if df.empty or 'query' not in df.columns:
|
| 992 |
+
return gr.update(choices=[], value=None)
|
| 993 |
|
| 994 |
queries = df['query'].unique().tolist()
|
| 995 |
# Return tuples of (truncated_label, full_value) for dropdown
|
|
|
|
| 1003 |
label = f"[{i+1}] {q_str}"
|
| 1004 |
truncated_queries.append((label, q_str))
|
| 1005 |
|
| 1006 |
+
return gr.update(choices=truncated_queries, value=None)
|
| 1007 |
|
| 1008 |
|
| 1009 |
def refresh_all():
|
|
|
|
| 1177 |
fn=refresh_all,
|
| 1178 |
outputs=[stats_html, stats_chart, graph_plot, embed_plot, circuit_html, circuit_chart]
|
| 1179 |
).then(
|
| 1180 |
+
fn=lambda: gr.update(maximum=max(0, len(current_data["df"]) - 1)),
|
| 1181 |
outputs=[token_slider]
|
| 1182 |
).then(
|
| 1183 |
fn=get_query_list,
|