Afsha001 commited on
Commit
b343af0
·
1 Parent(s): 7fff147

replace Qwen2-VL with Florence-2 API for caption generation

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -87,7 +87,7 @@ def generate_captions_api(image):
87
  "max_tokens": 80
88
  }
89
  response = requests.post(
90
- QWEN_VL_URL,
91
  headers=HF_HEADERS,
92
  json=payload,
93
  timeout=40
@@ -100,7 +100,7 @@ def generate_captions_api(image):
100
  st.warning("Qwen2-VL API error: " + str(response.status_code) + " " + response.text[:100])
101
  captions.append("a scene with various objects and people")
102
  except Exception as e:
103
- st.warning("Qwen2-VL exception: " + str(e))
104
  captions.append("a scene captured in the image")
105
 
106
  seen, unique = set(), []
 
87
  "max_tokens": 80
88
  }
89
  response = requests.post(
90
+
91
  headers=HF_HEADERS,
92
  json=payload,
93
  timeout=40
 
100
  st.warning("Qwen2-VL API error: " + str(response.status_code) + " " + response.text[:100])
101
  captions.append("a scene with various objects and people")
102
  except Exception as e:
103
+ st.warning("Florence-2 exception: " + str(e))
104
  captions.append("a scene captured in the image")
105
 
106
  seen, unique = set(), []