Skip to content

Commit

Permalink
fix(api): handle CUDA memory errors in workers
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Mar 15, 2023
1 parent a2e21f4 commit b2eb406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/onnx_web/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def worker_main(context: WorkerContext, server: ServerContext):
)
exit(EXIT_ERROR)
except Exception as e:
if "Failed to allocate memory" in str(e):
if "Failed to allocate memory" in str(e) or "CUDA out of memory" in str(e):
logger.error("detected out-of-memory error, exiting: %s", e)
exit(EXIT_MEMORY)
else:
Expand Down

0 comments on commit b2eb406

Please sign in to comment.