Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def infer():
|
|
43 |
img2text_tasks = fetch_task('img2text', fetch_all=True)
|
44 |
|
45 |
if not img2text_tasks:
|
46 |
-
return "No tasks found
|
47 |
|
48 |
for task in img2text_tasks:
|
49 |
try:
|
@@ -78,7 +78,7 @@ def infer():
|
|
78 |
update_task_status('img2text', task['id'], 'Successed', {"text": parsed_answer})
|
79 |
except Exception as e:
|
80 |
print(f"Error processing task {task['id']}: {e}")
|
81 |
-
update_task_status('img2text', task['id'], 'Failed', {"error": e})
|
82 |
return f"Error processing task {task['id']}: {e}"
|
83 |
|
84 |
return "Successed! No pending tasks found."
|
|
|
43 |
img2text_tasks = fetch_task('img2text', fetch_all=True)
|
44 |
|
45 |
if not img2text_tasks:
|
46 |
+
return "No tasks found."
|
47 |
|
48 |
for task in img2text_tasks:
|
49 |
try:
|
|
|
78 |
update_task_status('img2text', task['id'], 'Successed', {"text": parsed_answer})
|
79 |
except Exception as e:
|
80 |
print(f"Error processing task {task['id']}: {e}")
|
81 |
+
update_task_status('img2text', task['id'], 'Failed', {"error": str(e)})
|
82 |
return f"Error processing task {task['id']}: {e}"
|
83 |
|
84 |
return "Successed! No pending tasks found."
|