Molbap HF Staff commited on
Commit
54aa468
·
1 Parent(s): f800150

better images

Browse files
Files changed (2) hide show
  1. app.py +29 -0
  2. content/article.md +1 -1
app.py CHANGED
@@ -254,6 +254,27 @@ def build_fastrtc():
254
  rtc = WebRTC(mode="send-receive", modality="video")
255
  rtc.stream(ReplyOnPause(_echo_video), inputs=[rtc], outputs=[rtc], time_limit=60)
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  # ---------------------------
258
  # Inserts registry
259
  # ---------------------------
@@ -262,6 +283,14 @@ INSERTS = {
262
  "TERMINAL": build_terminal,
263
  "ATTN_VIS": build_attn_vis,
264
  "ALLOC_PLOT": build_alloc_plot,
 
 
 
 
 
 
 
 
265
  }
266
 
267
  # ---------------------------
 
254
  rtc = WebRTC(mode="send-receive", modality="video")
255
  rtc.stream(ReplyOnPause(_echo_video), inputs=[rtc], outputs=[rtc], time_limit=60)
256
 
257
+ # ---------------------------
258
+ # Image display functions
259
+ # ---------------------------
260
+
261
+ def build_image(filename):
262
+ def _build():
263
+ # Try both content/ and static/ directories
264
+ for directory in ['content', 'static']:
265
+ filepath = Path(directory) / filename
266
+ if filepath.exists():
267
+ gr.File(value=str(filepath), show_label=False, interactive=False)
268
+ return
269
+ gr.Markdown(f"*Image not found: {filename}*")
270
+ return _build
271
+
272
+ def build_d3_graph():
273
+ with gr.Group():
274
+ with open("static/d3_dependency_graph.html", "r") as f:
275
+ html_content = f.read()
276
+ gr.HTML(html_content, elem_id="d3-dependency-graph")
277
+
278
  # ---------------------------
279
  # Inserts registry
280
  # ---------------------------
 
283
  "TERMINAL": build_terminal,
284
  "ATTN_VIS": build_attn_vis,
285
  "ALLOC_PLOT": build_alloc_plot,
286
+ "D3_GRAPH": build_d3_graph,
287
+ # Image inserts
288
+ "graph_modular_related_models": build_image("graph_modular_related_models.png"),
289
+ "Jaccard_similarity_plot": build_image("Jaccard_similarity_plot.png"),
290
+ "Bloatedness_visualizer": build_image("Bloatedness_visualizer.png"),
291
+ "modular_candidates": build_image("modular_candidates.png"),
292
+ "popular_models_barplot": build_image("popular_models_barplot.png"),
293
+ "model_debugger": build_image("model_debugger.png"),
294
  }
295
 
296
  # ---------------------------
content/article.md CHANGED
@@ -264,7 +264,7 @@ So what do we see? Llama is a basis for many models, and it shows.
264
  Radically different architectures such as mamba have spawned their own dependency subgraph.
265
  [code relatedness](d3_dependency_graph.html)
266
 
267
- ![[graoh_modular_related_models.png]]
268
 
269
  But there is no similar miracle for VLMs across the board.
270
  As you can see, there is a small DETR island, a little llava pocket, and so on, but it's not comparable to the centrality observed.
 
264
  Radically different architectures such as mamba have spawned their own dependency subgraph.
265
  [code relatedness](d3_dependency_graph.html)
266
 
267
+ ![[graph_modular_related_models.png]]
268
 
269
  But there is no similar miracle for VLMs across the board.
270
  As you can see, there is a small DETR island, a little llava pocket, and so on, but it's not comparable to the centrality observed.