Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -198,7 +198,7 @@ async def docsum_imginter(file: UploadFile = File(...), task: str = Form(...)):
|
|
| 198 |
with open(file_path, "rb") as img_file:
|
| 199 |
image_bytes = img_file.read()
|
| 200 |
|
| 201 |
-
response = client.image_to_text(image=
|
| 202 |
|
| 203 |
caption = caption[0]["generated_text"] if caption and isinstance(caption, list) else "No caption generated"
|
| 204 |
return {"caption": caption}
|
|
|
|
| 198 |
with open(file_path, "rb") as img_file:
|
| 199 |
image_bytes = img_file.read()
|
| 200 |
|
| 201 |
+
response = client.image_to_text(image=image_bytes)
|
| 202 |
|
| 203 |
caption = caption[0]["generated_text"] if caption and isinstance(caption, list) else "No caption generated"
|
| 204 |
return {"caption": caption}
|