Abetharan Claude Opus 4.6 (1M context) commited on
Commit
a5490b4
·
1 Parent(s): fdc3012

Auto-render first sample on page load

Browse files

Uses app.load() to pre-render a random sample when the page opens,
so users see content immediately instead of an empty state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -410,6 +410,13 @@ def main():
410
  outputs=[plot_output, params_html, metrics_bar],
411
  )
412
 
 
 
 
 
 
 
 
413
  gr.Markdown(
414
  "<div style='text-align:center;padding:32px 0 8px;'>"
415
  "<span style='font-family:Inter,sans-serif;font-size:0.8rem;color:#6e6e6e;'>"
 
410
  outputs=[plot_output, params_html, metrics_bar],
411
  )
412
 
413
+ # Auto-run first sample on page load
414
+ app.load(
415
+ fn=on_random_sample,
416
+ inputs=[field_dd],
417
+ outputs=[plot_output, params_html, metrics_bar],
418
+ )
419
+
420
  gr.Markdown(
421
  "<div style='text-align:center;padding:32px 0 8px;'>"
422
  "<span style='font-family:Inter,sans-serif;font-size:0.8rem;color:#6e6e6e;'>"