Update app.py
Browse files
app.py
CHANGED
@@ -26,12 +26,12 @@ class AttachmentDownloadTool(Tool):
|
|
26 |
try:
|
27 |
response = requests.get(download_url + task_id, stream=True, timeout=15)
|
28 |
if response.status_code != 200:
|
29 |
-
return
|
30 |
file_obj = io.BytesIO(response.content)
|
31 |
file_obj.seek(0)
|
32 |
return file_obj
|
33 |
except Exception as e:
|
34 |
-
return
|
35 |
|
36 |
class ImageCaptionTool(Tool):
|
37 |
name = "image-captioner"
|
|
|
26 |
try:
|
27 |
response = requests.get(download_url + task_id, stream=True, timeout=15)
|
28 |
if response.status_code != 200:
|
29 |
+
return io.BytesIO()
|
30 |
file_obj = io.BytesIO(response.content)
|
31 |
file_obj.seek(0)
|
32 |
return file_obj
|
33 |
except Exception as e:
|
34 |
+
return io.BytesIO()
|
35 |
|
36 |
class ImageCaptionTool(Tool):
|
37 |
name = "image-captioner"
|