Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,6 @@ def generate_summary(product, tone):
|
|
| 45 |
- Ingredients: {ingredients}
|
| 46 |
- Nutrients: {nutrients}
|
| 47 |
- Packaging: {packaging}
|
| 48 |
-
|
| 49 |
Please provide a {tone} analysis including:
|
| 50 |
1. Positive aspects of the product.
|
| 51 |
2. Negative aspects of the product.
|
|
@@ -181,12 +180,14 @@ def main():
|
|
| 181 |
# st.write("### Product Analysis Summary:")
|
| 182 |
# st.success(st.session_state.summary)
|
| 183 |
product_names = [f"{p['product_name']} (Brand: {p.get('brands', 'Unknown')})" for p in products]
|
|
|
|
| 184 |
st.write(f"### Product Selected: {product_names[0]}")
|
| 185 |
with st.spinner("Generating AI-powered analysis..."):
|
| 186 |
summary = generate_summary(selected_product, tone.lower())
|
| 187 |
st.session_state.summary = summary
|
| 188 |
|
| 189 |
st.write("### Product Analysis Summary:")
|
|
|
|
| 190 |
|
| 191 |
|
| 192 |
|
|
@@ -200,7 +201,4 @@ def main():
|
|
| 200 |
""", unsafe_allow_html=True)
|
| 201 |
|
| 202 |
if __name__ == "__main__":
|
| 203 |
-
main()
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
|
|
|
| 45 |
- Ingredients: {ingredients}
|
| 46 |
- Nutrients: {nutrients}
|
| 47 |
- Packaging: {packaging}
|
|
|
|
| 48 |
Please provide a {tone} analysis including:
|
| 49 |
1. Positive aspects of the product.
|
| 50 |
2. Negative aspects of the product.
|
|
|
|
| 180 |
# st.write("### Product Analysis Summary:")
|
| 181 |
# st.success(st.session_state.summary)
|
| 182 |
product_names = [f"{p['product_name']} (Brand: {p.get('brands', 'Unknown')})" for p in products]
|
| 183 |
+
selected_product = products[0]
|
| 184 |
st.write(f"### Product Selected: {product_names[0]}")
|
| 185 |
with st.spinner("Generating AI-powered analysis..."):
|
| 186 |
summary = generate_summary(selected_product, tone.lower())
|
| 187 |
st.session_state.summary = summary
|
| 188 |
|
| 189 |
st.write("### Product Analysis Summary:")
|
| 190 |
+
st.success(st.session_state.summary)
|
| 191 |
|
| 192 |
|
| 193 |
|
|
|
|
| 201 |
""", unsafe_allow_html=True)
|
| 202 |
|
| 203 |
if __name__ == "__main__":
|
| 204 |
+
main()
|
|
|
|
|
|
|
|
|