Spaces:
Sleeping
Sleeping
UI changes
Browse files- .streamlit/config.toml +2 -0
- ui.py +9 -9
.streamlit/config.toml
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[theme]
|
2 |
+
baseFontSize = 20 # Set base font size to 20px (default is 16)
|
ui.py
CHANGED
@@ -58,7 +58,7 @@ def render_ui():
|
|
58 |
with st.container(border=True):
|
59 |
st.subheader("Input & Options")
|
60 |
# Handle button click *before* rendering the text area
|
61 |
-
if st.button("Load Examples", key="ingredient_examples"):
|
62 |
st.session_state.ingredient_input = load_examples() # Update state for next rerun
|
63 |
|
64 |
# Input section - Use the session state value
|
@@ -83,7 +83,7 @@ def render_ui():
|
|
83 |
top_n = st.slider("Top N Results", 1, 25, 10, step=1, key="ingredient_top_n")
|
84 |
confidence = st.slider("Similarity Threshold", 0.1, 0.9, 0.5, step=0.05, key="ingredient_confidence")
|
85 |
|
86 |
-
find_ingredients_btn = st.button("Find Similar Ingredients", type="primary", key="ingredient_find", use_container_width=True)
|
87 |
|
88 |
with col2:
|
89 |
with st.container(border=True):
|
@@ -120,7 +120,7 @@ def render_ui():
|
|
120 |
with col1:
|
121 |
with st.container(border=True):
|
122 |
st.subheader("Input & Options")
|
123 |
-
if st.button("Load Examples", key="category_examples"):
|
124 |
st.session_state.category_input = load_examples()
|
125 |
|
126 |
category_text_input = st.text_area(
|
@@ -143,7 +143,7 @@ def render_ui():
|
|
143 |
category_top_n = st.slider("Top N Categories", 1, 10, 5, step=1, key="category_top_n")
|
144 |
category_confidence = st.slider("Matching Threshold", 0.1, 0.9, 0.5, step=0.05, key="category_confidence")
|
145 |
|
146 |
-
match_categories_btn = st.button("Match to Categories", type="primary", key="category_match", use_container_width=True)
|
147 |
|
148 |
with col2:
|
149 |
with st.container(border=True):
|
@@ -180,7 +180,7 @@ def render_ui():
|
|
180 |
with col1:
|
181 |
with st.container(border=True):
|
182 |
st.subheader("Input & Options")
|
183 |
-
if st.button("Load Examples", key=f"{tab_key_prefix}_examples"):
|
184 |
st.session_state[f"{tab_key_prefix}_input"] = load_examples()
|
185 |
|
186 |
tab_input_value = st.text_area(
|
@@ -213,7 +213,7 @@ def render_ui():
|
|
213 |
tab_confidence = st.slider("Matching Threshold", 0.1, 0.9, 0.5, step=0.05, key=f"{tab_key_prefix}_confidence")
|
214 |
|
215 |
|
216 |
-
tab_match_btn = st.button(f"Match using {tab_name}", type="primary", key=f"{tab_key_prefix}_match", use_container_width=True)
|
217 |
|
218 |
with col2:
|
219 |
with st.container(border=True):
|
@@ -258,14 +258,14 @@ def render_ui():
|
|
258 |
with col1:
|
259 |
with st.container(border=True):
|
260 |
st.subheader("Input & Options")
|
261 |
-
if st.button("Load Examples", key="compare_examples"):
|
262 |
st.session_state.compare_input = load_examples()
|
263 |
|
264 |
compare_product_input_value = st.text_area(
|
265 |
"Product Names (one per line)",
|
266 |
value=st.session_state.compare_input,
|
267 |
placeholder="4 Tbsp sweet pickle relish\nchocolate chips\nfresh parsley",
|
268 |
-
height=
|
269 |
key="compare_input_widget"
|
270 |
)
|
271 |
st.session_state.compare_input = compare_product_input_value # Update state
|
@@ -304,7 +304,7 @@ def render_ui():
|
|
304 |
key="compare_confidence"
|
305 |
)
|
306 |
|
307 |
-
compare_btn = st.button("Compare Methods", type="primary", key="compare_run", use_container_width=True)
|
308 |
|
309 |
with col2:
|
310 |
with st.container(border=True):
|
|
|
58 |
with st.container(border=True):
|
59 |
st.subheader("Input & Options")
|
60 |
# Handle button click *before* rendering the text area
|
61 |
+
if st.button("Load Examples", key="ingredient_examples", icon="π"):
|
62 |
st.session_state.ingredient_input = load_examples() # Update state for next rerun
|
63 |
|
64 |
# Input section - Use the session state value
|
|
|
83 |
top_n = st.slider("Top N Results", 1, 25, 10, step=1, key="ingredient_top_n")
|
84 |
confidence = st.slider("Similarity Threshold", 0.1, 0.9, 0.5, step=0.05, key="ingredient_confidence")
|
85 |
|
86 |
+
find_ingredients_btn = st.button("Find Similar Ingredients", type="primary", key="ingredient_find", use_container_width=True, icon="π")
|
87 |
|
88 |
with col2:
|
89 |
with st.container(border=True):
|
|
|
120 |
with col1:
|
121 |
with st.container(border=True):
|
122 |
st.subheader("Input & Options")
|
123 |
+
if st.button("Load Examples", key="category_examples", icon="π"):
|
124 |
st.session_state.category_input = load_examples()
|
125 |
|
126 |
category_text_input = st.text_area(
|
|
|
143 |
category_top_n = st.slider("Top N Categories", 1, 10, 5, step=1, key="category_top_n")
|
144 |
category_confidence = st.slider("Matching Threshold", 0.1, 0.9, 0.5, step=0.05, key="category_confidence")
|
145 |
|
146 |
+
match_categories_btn = st.button("Match to Categories", type="primary", key="category_match", use_container_width=True, icon="π")
|
147 |
|
148 |
with col2:
|
149 |
with st.container(border=True):
|
|
|
180 |
with col1:
|
181 |
with st.container(border=True):
|
182 |
st.subheader("Input & Options")
|
183 |
+
if st.button("Load Examples", key=f"{tab_key_prefix}_examples", icon="π"):
|
184 |
st.session_state[f"{tab_key_prefix}_input"] = load_examples()
|
185 |
|
186 |
tab_input_value = st.text_area(
|
|
|
213 |
tab_confidence = st.slider("Matching Threshold", 0.1, 0.9, 0.5, step=0.05, key=f"{tab_key_prefix}_confidence")
|
214 |
|
215 |
|
216 |
+
tab_match_btn = st.button(f"Match using {tab_name}", type="primary", key=f"{tab_key_prefix}_match", use_container_width=True, icon="π")
|
217 |
|
218 |
with col2:
|
219 |
with st.container(border=True):
|
|
|
258 |
with col1:
|
259 |
with st.container(border=True):
|
260 |
st.subheader("Input & Options")
|
261 |
+
if st.button("Load Examples", key="compare_examples", icon="π"):
|
262 |
st.session_state.compare_input = load_examples()
|
263 |
|
264 |
compare_product_input_value = st.text_area(
|
265 |
"Product Names (one per line)",
|
266 |
value=st.session_state.compare_input,
|
267 |
placeholder="4 Tbsp sweet pickle relish\nchocolate chips\nfresh parsley",
|
268 |
+
height=200, # Consistent height
|
269 |
key="compare_input_widget"
|
270 |
)
|
271 |
st.session_state.compare_input = compare_product_input_value # Update state
|
|
|
304 |
key="compare_confidence"
|
305 |
)
|
306 |
|
307 |
+
compare_btn = st.button("Compare Methods", type="primary", key="compare_run", use_container_width=True, icon="π")
|
308 |
|
309 |
with col2:
|
310 |
with st.container(border=True):
|