Skip to content

Conversation

HonorRong
Copy link

No description provided.


tokenizer = AutoTokenizer.from_pretrained(model_path)
model.eval()
model.eval().to(device)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device_map value "auto" can't be used in tensor.to(device) or model.eval().to(device). Valid device values are cpu, cuda, ipu, xpu, mkldnn, opengl, opencl, ideep, hip, ve, fpga, ort, xla, lazy, vulkan, mps, meta, hpu, mtia, privateuseone.

prompt_postfix = "What is the pass key? The pass key is "
prompt = example["input"] + prompt_postfix
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device_map value "auto" can't be used in tensor.to(device) or model.eval().to(device). Valid device values are cpu, cuda, ipu, xpu, mkldnn, opengl, opencl, ideep, hip, ve, fpga, ort, xla, lazy, vulkan, mps, meta, hpu, mtia, privateuseone.

print( "-----------------------------------\n" )

if torch.backends.mps.is_available():
torch.mps.empty_cache()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a pytorch issue in pytorch/pytorch#105839 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants