Luisgust commited on
Commit
7dca8cc
·
verified ·
1 Parent(s): f609e95

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -1
main.py CHANGED
@@ -19,7 +19,8 @@ except Exception as e:
19
  async def get_caption(image: UploadFile = File(...), context: str = Form(...)):
20
  try:
21
  contents = await image.read()
22
- image_data = handle_file(contents, orig_name=image.filename)
 
23
 
24
  result = client.predict(
25
  image=image_data,
 
19
  async def get_caption(image: UploadFile = File(...), context: str = Form(...)):
20
  try:
21
  contents = await image.read()
22
+ # Remove orig_name if it's not supported by handle_file
23
+ image_data = handle_file(contents)
24
 
25
  result = client.predict(
26
  image=image_data,