Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -95,17 +95,15 @@ def page2():
|
|
95 |
st.text("Using Scrapfly")
|
96 |
brand_summary_html = create_screenshot_from_scrap_fly(brand_link)
|
97 |
if brand_summary_html["success"]:
|
98 |
-
compressed_image = f"comp_brand_{random.randint(1, 100000000)}.png"
|
99 |
-
comp = check_and_compress_image(brand_summary_html["location"], compressed_image)
|
100 |
-
if comp["success"]:
|
101 |
-
|
102 |
-
|
103 |
-
else:
|
104 |
-
|
105 |
-
brand_image_embed = embed_base64_for_claude(brand_summary_html["location"])
|
106 |
-
brand_summary_response =
|
107 |
-
"Fashion expert of understanding brand details",
|
108 |
-
st.session_state["brand_prompt"], brand_image_embed)
|
109 |
st.session_state['brand_summary'] = brand_summary_response
|
110 |
else:
|
111 |
st.text(f"Scrapfly failed due to: {brand_summary_html}")
|
|
|
95 |
st.text("Using Scrapfly")
|
96 |
brand_summary_html = create_screenshot_from_scrap_fly(brand_link)
|
97 |
if brand_summary_html["success"]:
|
98 |
+
# compressed_image = f"comp_brand_{random.randint(1, 100000000)}.png"
|
99 |
+
# comp = check_and_compress_image(brand_summary_html["location"], compressed_image)
|
100 |
+
# if comp["success"]:
|
101 |
+
# st.image(compressed_image)
|
102 |
+
# brand_image_embed = embed_base64_for_claude(compressed_image)
|
103 |
+
# else:
|
104 |
+
st.image(brand_summary_html["location"])
|
105 |
+
# brand_image_embed = embed_base64_for_claude(brand_summary_html["location"])
|
106 |
+
brand_summary_response = create_image_completion_request_gpt(brand_summary_html["location"], st.session_state["brand_prompt"])
|
|
|
|
|
107 |
st.session_state['brand_summary'] = brand_summary_response
|
108 |
else:
|
109 |
st.text(f"Scrapfly failed due to: {brand_summary_html}")
|