ProfessorLeVesseur commited on
Commit
dbe5bdc
·
verified ·
1 Parent(s): e4af4b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -190,11 +190,10 @@ def query_image_caption(image):
190
  image.save(buffered, format="JPEG")
191
  image_bytes = buffered.getvalue()
192
 
193
- # Use the InferenceClient to query the image captioning model
194
- response = client.post(
195
  model="Salesforce/blip-image-captioning-large",
196
- data=image_bytes,
197
- headers={"Content-Type": "application/octet-stream"},
198
  )
199
  return response
200
 
 
190
  image.save(buffered, format="JPEG")
191
  image_bytes = buffered.getvalue()
192
 
193
+ # Use the InferenceClient's image_to_text method
194
+ response = client.image_to_text(
195
  model="Salesforce/blip-image-captioning-large",
196
+ image=image_bytes,
 
197
  )
198
  return response
199