skarugu commited on
Commit
fffcba8
·
verified ·
1 Parent(s): 1f3fffe

Updated Streamlit App

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +32 -2
src/streamlit_app.py CHANGED
@@ -1694,9 +1694,24 @@ def render_v2_training_panel(image_size: int, key_prefix: str = "v2_top"):
1694
 
1695
  if latest_model.exists():
1696
  st.success(f"Local v2 model exists: {latest_model}")
 
 
 
 
 
 
 
1697
  if latest_metrics.exists():
1698
  try:
1699
- st.json(json.loads(latest_metrics.read_text()))
 
 
 
 
 
 
 
 
1700
  except Exception:
1701
  st.caption(f"Metrics file exists: {latest_metrics}")
1702
 
@@ -2671,9 +2686,24 @@ with st.expander("Train v2 model"):
2671
 
2672
  if latest_model.exists():
2673
  st.success(f"Local v2 model exists: {latest_model}")
 
 
 
 
 
 
 
2674
  if latest_metrics.exists():
2675
  try:
2676
- st.json(json.loads(latest_metrics.read_text()))
 
 
 
 
 
 
 
 
2677
  except Exception:
2678
  st.caption(f"Metrics file exists: {latest_metrics}")
2679
 
 
1694
 
1695
  if latest_model.exists():
1696
  st.success(f"Local v2 model exists: {latest_model}")
1697
+ st.download_button(
1698
+ "Download model_v2.pt",
1699
+ data=latest_model.read_bytes(),
1700
+ file_name="model_v2.pt",
1701
+ mime="application/octet-stream",
1702
+ key=f"{key_prefix}_download_model",
1703
+ )
1704
  if latest_metrics.exists():
1705
  try:
1706
+ metrics_text = latest_metrics.read_text()
1707
+ st.json(json.loads(metrics_text))
1708
+ st.download_button(
1709
+ "Download metrics_v2.json",
1710
+ data=metrics_text,
1711
+ file_name="metrics_v2.json",
1712
+ mime="application/json",
1713
+ key=f"{key_prefix}_download_metrics",
1714
+ )
1715
  except Exception:
1716
  st.caption(f"Metrics file exists: {latest_metrics}")
1717
 
 
2686
 
2687
  if latest_model.exists():
2688
  st.success(f"Local v2 model exists: {latest_model}")
2689
+ st.download_button(
2690
+ "Download model_v2.pt",
2691
+ data=latest_model.read_bytes(),
2692
+ file_name="model_v2.pt",
2693
+ mime="application/octet-stream",
2694
+ key="v2_bottom_download_model",
2695
+ )
2696
  if latest_metrics.exists():
2697
  try:
2698
+ metrics_text = latest_metrics.read_text()
2699
+ st.json(json.loads(metrics_text))
2700
+ st.download_button(
2701
+ "Download metrics_v2.json",
2702
+ data=metrics_text,
2703
+ file_name="metrics_v2.json",
2704
+ mime="application/json",
2705
+ key="v2_bottom_download_metrics",
2706
+ )
2707
  except Exception:
2708
  st.caption(f"Metrics file exists: {latest_metrics}")
2709