Molbap HF Staff commited on
Commit
ceffe7d
·
1 Parent(s): 0bf31be
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -70,7 +70,12 @@ def run(repo_url: str, threshold: float, multimodal: bool, sim_method: str):
70
  return html, str(json_path)
71
 
72
 
73
- with gr.Blocks(css="body{background:#fafafa;}") as demo:
 
 
 
 
 
74
  gr.Markdown("## 🔍 Modular‑candidate explorer for 🤗 Transformers")
75
 
76
  with gr.Row():
@@ -80,10 +85,10 @@ with gr.Blocks(css="body{background:#fafafa;}") as demo:
80
  sim_radio = gr.Radio(["jaccard", "embedding"], value="jaccard", label="Similarity metric")
81
  go_btn = gr.Button("Build graph")
82
 
83
- html_out = gr.HTML()
84
  json_out = gr.File(label="Download graph.json")
85
 
86
  go_btn.click(run, [repo_in, thresh, multi_cb, sim_radio], [html_out, json_out])
87
 
88
  if __name__ == "__main__":
89
- demo.launch()
 
70
  return html, str(json_path)
71
 
72
 
73
+
74
+ CUSTOM_CSS = """
75
+ #graph_html iframe {height:85vh !important; width:100% !important; border:none;}
76
+ """
77
+
78
+ with gr.Blocks(css=CUSTOM_CSS) as demo:
79
  gr.Markdown("## 🔍 Modular‑candidate explorer for 🤗 Transformers")
80
 
81
  with gr.Row():
 
85
  sim_radio = gr.Radio(["jaccard", "embedding"], value="jaccard", label="Similarity metric")
86
  go_btn = gr.Button("Build graph")
87
 
88
+ html_out = gr.HTML(elem_id="graph_html", sanitize=False, show_label=False)
89
  json_out = gr.File(label="Download graph.json")
90
 
91
  go_btn.click(run, [repo_in, thresh, multi_cb, sim_radio], [html_out, json_out])
92
 
93
  if __name__ == "__main__":
94
+ demo.launch()