mirror of
https://github.com/OLmatter/glm-coding-helper.git
synced 2026-10-07 15:58:34 +08:00
PaddleOCR 通过 modelscope 自动探测并加载 torch,但 torch 与 paddle 在同一进程中初始化 CUDA 会触发 pybind11 类型注册冲突 (_gpuDeviceProperties already registered)。 通过 monkey-patch importlib.util.find_spec,对 modelscope 隐藏 torch 的存在,使其跳过 torch 加载,仅在 paddle 进程中生效。 同时补充 cuda_runtime/bin 到 DLL 搜索路径。