VLMEvalKit icon indicating copy to clipboard operation
VLMEvalKit copied to clipboard

cogvlm2-llama3-chat-19B设置device_map="auto"报错

Open Michel-liu opened this issue 2 years ago • 0 comments

如题,推理时单卡放不下整个模型,但是为vlmeval/vlm/cogvlm.py中的model = AutoModelForCausalLM.from_pretrained添加device_map="auto"报错

model = AutoModelForCausalLM.from_pretrained(
            model_path,
            torch_dtype=torch.bfloat16,
            trust_remote_code=True,
            device_map="auto").eval()
image

提示不在同一个device RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:5 and cuda:6!

Michel-liu avatar Aug 27 '24 01:08 Michel-liu