Anon commited on
Commit ·
0c0f584
1
Parent(s): bebc9e3
update bytes.
Browse files- src/streamlit_app.py +12 -8
src/streamlit_app.py
CHANGED
|
@@ -1,9 +1,8 @@
|
|
| 1 |
import os
|
| 2 |
import re
|
| 3 |
from pathlib import Path
|
| 4 |
-
|
| 5 |
-
import altair as alt
|
| 6 |
import numpy as np
|
|
|
|
| 7 |
import pandas as pd
|
| 8 |
import streamlit as st
|
| 9 |
|
|
@@ -76,11 +75,13 @@ else:
|
|
| 76 |
feature_options = sorted(gifs_df["features"].unique().tolist())
|
| 77 |
hidden_options = sorted(gifs_df["hidden_dim"].unique().tolist())
|
| 78 |
|
| 79 |
-
|
| 80 |
-
with
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
|
|
|
|
|
|
| 84 |
|
| 85 |
# Filter + sort by sparsity (instance)
|
| 86 |
filtered = gifs_df[
|
|
@@ -99,6 +100,9 @@ else:
|
|
| 99 |
items = filtered.to_dict(orient="records")
|
| 100 |
for item in items:
|
| 101 |
caption = f"{item['sparsity']} out of {item['sparsity_out_of']}"
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
st.divider()
|
|
|
|
| 1 |
import os
|
| 2 |
import re
|
| 3 |
from pathlib import Path
|
|
|
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
+
|
| 6 |
import pandas as pd
|
| 7 |
import streamlit as st
|
| 8 |
|
|
|
|
| 75 |
feature_options = sorted(gifs_df["features"].unique().tolist())
|
| 76 |
hidden_options = sorted(gifs_df["hidden_dim"].unique().tolist())
|
| 77 |
|
| 78 |
+
left, _ = st.columns([2, 5]) # empty column eats the space
|
| 79 |
+
with left:
|
| 80 |
+
c1, c2 = st.columns([1, 1], gap="small")
|
| 81 |
+
with c1:
|
| 82 |
+
selected_features = st.selectbox("Number of features (nf)", feature_options)
|
| 83 |
+
with c2:
|
| 84 |
+
selected_hidden = st.selectbox("Hidden dimension (nh)", hidden_options)
|
| 85 |
|
| 86 |
# Filter + sort by sparsity (instance)
|
| 87 |
filtered = gifs_df[
|
|
|
|
| 100 |
items = filtered.to_dict(orient="records")
|
| 101 |
for item in items:
|
| 102 |
caption = f"{item['sparsity']} out of {item['sparsity_out_of']}"
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
gif_bytes = Path(item["path"]).read_bytes()
|
| 106 |
+
st.image(gif_bytes, caption=caption) # should animate
|
| 107 |
|
| 108 |
st.divider()
|