Nerva1228 commited on
Commit
cadc76c
·
verified ·
1 Parent(s): 740085d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 or failed to fetch tasks."
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."