Spaces:
Sleeping
Sleeping
Update app.py
Browse files56 unmodified lines57585960616263646566676856 unmodified linesreturn _make_vis_updates(count) + [count]def load_example(example_idx):if example_idx is None:query_upd = gr.update(value="")doc_upds = [gr.update(value="") for _ in range(MAX_DOCS)]return [query_upd] + doc_upds + [INIT_DOCS]ex = EXAMPLES[example_idx]docs = ex["docs"]count = len(docs)query_upd = gr.update(value=ex["query"])56 unmodified lines575859606162636465666768697056 unmodified linesreturn _make_vis_updates(count) + [count]def load_example(example_label):if example_label is None:query_upd = gr.update(value="")doc_upds = [gr.update(value="") for _ in range(MAX_DOCS)]return [query_upd] + doc_upds + [INIT_DOCS]ex = next((e for e in EXAMPLES if e["label"] == example_label), None)if ex is None:return [gr.update()] + [gr.update() for _ in range(MAX_DOCS)] + [INIT_DOCS]docs = ex["docs"]count = len(docs)query_upd = gr.update(value=ex["query"])
app.py+5-3