Anustup commited on
Commit
cc82cda
·
verified ·
1 Parent(s): 3f02bf3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -96,8 +96,11 @@ def page2():
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
- check_and_compress_image(brand_summary_html["location"], compressed_image)
100
- brand_image_embed = embed_base64_for_claude(compressed_image)
 
 
 
101
  brand_summary_response = create_claude_image_request_for_image_captioning(
102
  "Fashion expert of understanding brand details",
103
  st.session_state["brand_prompt"], brand_image_embed)
 
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
+ brand_image_embed = embed_base64_for_claude(compressed_image)
102
+ else:
103
+ brand_image_embed = embed_base64_for_claude(brand_summary_html["location"])
104
  brand_summary_response = create_claude_image_request_for_image_captioning(
105
  "Fashion expert of understanding brand details",
106
  st.session_state["brand_prompt"], brand_image_embed)