Addresses all reviewer feedback: 1. Moved os.execv out of module-level code into a helper function _maybe_reexec_for_cuda_ld_path() that is called explicitly from run_server() and __main__. Importing run.py no longer replaces the host process -- safe for CLI, notebooks, tests, and embedders. 2. Changed platform guard from "not win32" to "linux only", since LD_LIBRARY_PATH is a Linux-specific linker mechanism. 3. Use sys.orig_argv (Python 3.10+) when available to preserve the original interpreter invocation (python -m, -c, -X flags, etc.). Falls back to [sys.executable] + sys.argv for older Python. |
||
|---|---|---|
| .. | ||
| assets | ||
| auth | ||
| core | ||
| loggers | ||
| models | ||
| plugins | ||
| requirements | ||
| routes | ||
| state | ||
| tests | ||
| utils | ||
| __init__.py | ||
| colab.py | ||
| main.py | ||
| run.py | ||