Update main.py
Browse files
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 |
-
|
|
|
|
| 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,
|