ValueError: model.decoder.embed_tokens.weight doesn't have any device set.

#14
by sxx123 - opened

from transformers import AutoTokenizer, OPTForCausalLM

tokenizer = AutoTokenizer.from_pretrained("facebook/galactica-6.7b")
model = OPTForCausalLM.from_pretrained("facebook/galactica-6.7b", device_map={"cuda:0": "cuda"})

input_text = "The Transformer architecture [START_REF]"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda:0")

outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
有人垮我看看这䞪问题吗感谢🙇‍

Sign up or log in to comment