Skip to content

fix(embedding): prevent unhandled Exception in vllm teardown when torch is missing(#1156)#1257

Open
Abhinav2656 wants to merge 1 commit into
Marker-Inc-Korea:mainfrom
Abhinav2656:fix/web-run-issue
Open

fix(embedding): prevent unhandled Exception in vllm teardown when torch is missing(#1156)#1257
Abhinav2656 wants to merge 1 commit into
Marker-Inc-Korea:mainfrom
Abhinav2656:fix/web-run-issue

Conversation

@Abhinav2656

Copy link
Copy Markdown

Resolves: Closes #1156

What this PR does:
While looking into the autorag run web issue reported in #1156 (which happens because the command was deprecated in favor of run_web), I noticed it exposed a secondary bug: the app crashes with an unhandled exception on exit if you don't have PyTorch installed.

In autorag/embedding/vllm.py, the atexit teardown hook was hard-importing torch. For users running the API version of AutoRAG without local GPU dependencies, this causes a ModuleNotFoundError during the shutdown routine.

I’ve wrapped the teardown imports in a try/except ImportError block. Now, if torch isn't found, the app realizes there's no CUDA memory to clean and just exits gracefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run web not working

1 participant