Feriel080 commited on
Commit
0d3608a
·
verified ·
1 Parent(s): 087d386

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -1
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=img_file)
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}