Update app.py
Browse files
app.py
CHANGED
@@ -78,6 +78,7 @@ def run_timeline(repo_url: str, threshold: float, multimodal: bool, sim_method:
|
|
78 |
CUSTOM_CSS = """
|
79 |
#graph_html iframe, #timeline_html iframe {height:85vh !important; width:100% !important; border:none;}
|
80 |
"""
|
|
|
81 |
|
82 |
with gr.Blocks(css=CUSTOM_CSS) as demo:
|
83 |
gr.Markdown("## π Modular-candidate explorer for π€ Transformers")
|
@@ -126,10 +127,12 @@ with gr.Blocks(css=CUSTOM_CSS) as demo:
|
|
126 |
)
|
127 |
|
128 |
def _select_tab_on_load(req: gr.Request):
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
133 |
|
134 |
demo.load(_select_tab_on_load, outputs=tabs)
|
135 |
|
|
|
78 |
CUSTOM_CSS = """
|
79 |
#graph_html iframe, #timeline_html iframe {height:85vh !important; width:100% !important; border:none;}
|
80 |
"""
|
81 |
+
TAB_INDEX = {"timeline": 0, "loc": 1, "graph": 2}
|
82 |
|
83 |
with gr.Blocks(css=CUSTOM_CSS) as demo:
|
84 |
gr.Markdown("## π Modular-candidate explorer for π€ Transformers")
|
|
|
127 |
)
|
128 |
|
129 |
def _select_tab_on_load(req: gr.Request):
|
130 |
+
qp = req.query_params or {}
|
131 |
+
key = (qp.get("tab") or "").lower()
|
132 |
+
idx = TAB_INDEX.get(key)
|
133 |
+
if idx is not None:
|
134 |
+
return gr.Tabs.update(selected=idx)
|
135 |
+
return gr.Tabs.update()
|
136 |
|
137 |
demo.load(_select_tab_on_load, outputs=tabs)
|
138 |
|