guillaume-be / rust-bert

Rust native ready-to-use NLP pipelines and transformer-based models (BERT, DistilBERT, GPT2,...)
https://docs.rs/crate/rust-bert
Apache License 2.0
2.67k stars 216 forks source link

Fine-tuning Marian model can't use pipeline doing translate task #415

Open wolf-li opened 1 year ago

wolf-li commented 1 year ago

Fine-tuning Marian model use huggingface transformers library. Translate model to rust_model.ot format. Can't use pipelien translate. This is the erroer message.

Tch tensor error: cannot find the tensor named model.decoder.embed_positions.weight

How do I solve this?

guillaume-be commented 1 year ago

Hello,

This error message gives you the expected weights name in the parameters dictionary of the model. What do your original model parameters keys look like before export?

wolf-li commented 1 year ago

Hello,

This error message gives you the expected weights name in the parameters dictionary of the model. What do your original model parameters keys look like before export?

Thanks for your replay. How do I check "original model parameters keys"? Can you explain this? I use the Seq2SeqTrainingArguments and Seq2SeqTrainer fine-tuning the Marian model.