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

Canʻt get past Sentencepiece subword tokenization with pretrained embeddings #2581

Closed
HURIMOZ opened this issue Apr 14, 2024 · 0 comments
Closed

Comments

@HURIMOZ
Copy link

HURIMOZ commented Apr 14, 2024

Hi, Iʻm building a bilingual translation model (Transformer) with SentencePiece subword tokenization for both source and target data, and with subword pretrained embeddings for the source data.

The system will not be happy with a simple command like onmt_train -config config.yaml as it will throw this error:
onmt_train: error: the following arguments are required: -src_vocab/–src_vocab even though the config file is correctly pointing at those vocab files generated by sentencepiece.

So I try command onmt_train -config config.yaml -src_vocab data/src_spm.vocab -tgt_vocab data/tgt_spm.vocab -gpu_ranks 0 but then I get this error: AssertionError: -save_data should be set if use pretrained embeddings

So I tried to rebuild vocabularies with the onmt_build_vocab module: onmt_build_vocab -config config.yaml -n_sample 80000 -save_data data/processed -src_vocab data/src_spm.vocab -tgt_vocab data/tgt_spm.vocab but again I got stuck with this error: raise IOError(f"path {path} exists, stop.")
OSError: path data/src_spm.vocab exists, stop.

Given that I have already trained my SentencePiece models and vocabs I should not need to run onmt_build_vocab to create separate vocabulary files again. The SentencePiece models (src_spm.model and tgt_spm.model) and their corresponding vocabularies (src_spm.vocab and tgt_spm.vocab) should suffice for training, right?

Any help welcome!
Thank you,
Tamatoa

@HURIMOZ HURIMOZ closed this as completed Apr 15, 2024
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