QwenLM / Qwen2-VL

Qwen2-VL is the multimodal large language model series developed by Qwen team, Alibaba Cloud.
Apache License 2.0
3.13k stars 190 forks source link

[BUG] RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:5 and cuda:6! #270

Open DankoZhang opened 1 month ago

DankoZhang commented 1 month ago

执行如下代码报错,是什么情况呢 from transformers import AutoTokenizer, AutoModelForCausalLM model_path = "/mmu_cd_ssd/zhangce07/MLLM/Qwen/Qwen-VL-Chat/"

qwen_model = AutoModelForCausalLM.from_pretrained(model_path, device_map="auto", trust_remote_code=True).eval()

query = qwen_tokenizer.from_list_format([ {'image': 'xxx'}, # Either a local path or an url {'text': "xxx"}, ])

response, history = qwen_model.chat(qwen_tokenizer, query=query, history=None) print(response)

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:5 and cuda:6!

DankoZhang commented 1 month ago

@fyabc 可以帮忙看看吗

Godricly commented 1 month ago

same error here.

yangshiyu89 commented 1 month ago

same error here.