ghchen18 / emnlp2021-sixt

Code for EMNLP 2021 paper 'Zero-shot Cross-lingual Transfer of NMT with Multilingual Pretrained Encoders'
MIT License
9 stars 4 forks source link

got a problem when I ran the preprocess.sh #1

Closed liushiyan-66 closed 1 year ago

liushiyan-66 commented 1 year ago

got a problem when i ran the preprocess.sh

here is what's causing my program to go wrong in the preprocess.sh --------python scripts/save_embed.py --fseqdir $fseq \ --modeldir /home/lsy/code/sixt/fairseq/models/xlmrbase --src $src --tgt $tgt \ --outfile $fseq/xlmr${tgt}_emb.pt

and this is the problem

now start to extract target embeddings ... Traceback (most recent call last): File "scripts/save_embed.py", line 59, in main() File "scripts/save_embed.py", line 44, in main XLMR = XLMRModel.from_pretrained(args.modeldir, checkpoint_file='model.pt') File "/home/lsy/code/sixtp/fairseq/models/roberta/model_xlmr.py", line 43, in from_pretrained return RobertaHubInterface(x["args"], x["task"], x["models"][0]) File "/home/lsy/code/sixtp/fairseq/models/roberta/hub_interface.py", line 29, in init self.bpe = encoders.build_bpe(bpe_set) File "/home/lsy/code/sixtp/fairseq/registry.py", line 61, in build_x return builder(cfg, *extra_args, **extra_kwargs) File "/home/lsy/code/sixtp/fairseq/data/encoders/sentencepiece_bpe.py", line 23, in init sentencepiece_model = file_utils.cached_path(cfg.sentencepiece_model) File "/home/lsy/code/sixtp/fairseq/file_utils.py", line 166, in cached_path raise EnvironmentError("file {} not found".format(url_or_filename)) OSError: file /path/to/your/work/location/models/xlmrL_base/sentencepiece.bpe.model not found

idk why i've changed the content of workloc, but it did't work.

ghchen18 commented 1 year ago

You can use pdb package to see what's going on. Maybe there are other paths to be configured in the code.