ValueError: The state dictionary of the model you are trying to load is corrupted.

#55
by dsbyprateekg - opened

Code-
image.png

Error-

image.png

Environment-
Colab T4 GPU

BigScience Workshop org
edited Jan 23

ur trying to load mt0 with the bloom model; u need to load it w/ the mt0 model (i.e. t5 i think) - the script is in its modelcard

cakiki changed discussion status to closed

@Muennighoff can you please share the code snippet how to do that?

BigScience Workshop org

From https://huggingface.co/bigscience/mt0-small

# pip install -q transformers accelerate
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

checkpoint = "bigscience/mt0-small"

tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint, torch_dtype="auto", device_map="auto")

inputs = tokenizer.encode("Translate to English: Je t’aime.", return_tensors="pt").to("cuda")
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))

@Muennighoff Thanks!
It's working now.

Sign up or log in to comment