RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:7 and cpu! (when checking argument for argument index in method wrapper_CUDA__index_select)`

该报错通常发生在旧版 Transformers 中对小型 GPT-2 模型使用 device_map="auto" 且模型被切分到多张 GPU 时,原因是旧的 balanced device-map 算法没有将 tied weights( transformer.wte.weight 与 lm_he


![[Feature Request]: Add MonkeyOCRv2 as a document parsing backend (working adapter included)](https://www.chat-gpts.plus/wp-content/uploads/2026/09/18671-00b219e6-768x403.jpg)





