Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fine-tuned T5 model fails to load after recent change #1034

Open
msolo opened this issue Oct 12, 2024 · 0 comments
Open

fine-tuned T5 model fails to load after recent change #1034

msolo opened this issue Oct 12, 2024 · 0 comments

Comments

@msolo
Copy link

msolo commented Oct 12, 2024

Directly importing a fine-tuned T5 model, like willwade/t5-small-spoken-typo fails with the following exception:

python t5.py --model willwade/t5-small-spoken-typo --prompt "grammar: A tasty apple"
  File "./mlx-examples/t5/t5.py", line 495, in <module>
    model, tokenizer = T5.from_pretrained(args.model, dtype)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "./mlx-examples/t5/t5.py", line 427, in from_pretrained
    model.load_weights(list(weights.items()))
  File "/mlx/nn/layers/base.py", line 178, in load_weights
    raise ValueError(f"Received parameters not in model: {extras}.")
ValueError: Received parameters not in model: decoder.layers.1.dense.wi.weight encoder.layers.0.dense.wi.weight decoder.layers.3.dense.wi.weight encoder.layers.1.dense.wi.weight encoder.layers.5.dense.wi.weight encoder.layers.3.dense.wi.weight encoder.layers.4.dense.wi.weight decoder.layers.0.dense.wi.weight decoder.layers.2.dense.wi.weight encoder.layers.2.dense.wi.weight decoder.layers.5.dense.wi.weight decoder.layers.4.dense.wi.weight.

After a recent commit d72fdeb, there is no longer a convert.py for T5 models.

Reverting d72fdeb and running convert.py to generate an .npz restores the expected functionality.

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

No branches or pull requests

1 participant