Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 194 |
-
response = client.
|
| 195 |
model="Salesforce/blip-image-captioning-large",
|
| 196 |
-
|
| 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 |
|