Spaces:
Runtime error
Runtime error
removed select box because it is worthless
Browse files
app.py
CHANGED
@@ -35,25 +35,27 @@ with st.spinner("Loading Model"):
|
|
35 |
|
36 |
select_idx = None
|
37 |
|
38 |
-
class OnChange():
|
39 |
-
def __init__(self, idx):
|
40 |
-
self.idx = idx
|
41 |
-
|
42 |
-
def __call__(self):
|
43 |
-
st.write(f"the idx is: {self.idx}")
|
44 |
-
st.write(f"the sample_image is {sample_image}")
|
45 |
-
|
46 |
st.sidebar.title("Select a sample image")
|
47 |
|
48 |
if st.sidebar.button("Random Sample Image"):
|
49 |
select_idx = get_rand_idx(sample_images)
|
50 |
-
|
51 |
-
sample_image =
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
st.sidebar.title("Select a Subreddit")
|
59 |
sub = st.sidebar.selectbox(
|
|
|
35 |
|
36 |
select_idx = None
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
st.sidebar.title("Select a sample image")
|
39 |
|
40 |
if st.sidebar.button("Random Sample Image"):
|
41 |
select_idx = get_rand_idx(sample_images)
|
42 |
+
|
43 |
+
sample_image = sample_images[0 if select_idx is None else select_idx]
|
44 |
+
|
45 |
+
# class OnChange():
|
46 |
+
# def __init__(self, idx):
|
47 |
+
# self.idx = idx
|
48 |
+
|
49 |
+
# def __call__(self):
|
50 |
+
# st.write(f"the idx is: {self.idx}")
|
51 |
+
# st.write(f"the sample_image is {sample_image}")
|
52 |
+
|
53 |
+
# sample_image = st.sidebar.selectbox(
|
54 |
+
# "",
|
55 |
+
# sample_images,
|
56 |
+
# index = 0 if select_idx is None else select_idx,
|
57 |
+
# on_change=OnChange(0 if select_idx is None else select_idx)
|
58 |
+
# )
|
59 |
|
60 |
st.sidebar.title("Select a Subreddit")
|
61 |
sub = st.sidebar.selectbox(
|