Closed SnoozingSimian closed 3 years ago
I was trying to preprocess a text file using the script from fairseq_cli/preprocess.py on Google colabs, and I got the following error.
fairseq_cli/preprocess.py
ModuleNotFoundError: No module named 'examples.simultaneous_translation'
It is pretty simple, I installed fairseq on Google Colab and tried to use the preprocess.py script.
preprocess.py
I had installed fairseq using
fairseq
!git clone https://github.com/pytorch/fairseq %cd fairseq !pip install --editable ./ %cd ..
And then tried to run the aforementioned script on my text file
!python "fairseq/fairseq_cli/preprocess.py" --only-source --trainpref "/content/text.txt" --destdir "/content/cleaned" --thresholdsrc 10 --padding-factor 1 --workers 16 --nwordstgt 200000
To see if everything was in order I tried simply importing simultaneous_translation as follows
from fairseq.examples import simultaneous_translation
Which also gave me same the error
!pip install --editable ./
I was able to solve this by doing a simple !pip install fairseq and then cloning the repo afterwards as mentioned here. Closing this issue.
!pip install fairseq
I was trying to preprocess a text file using the script from
fairseq_cli/preprocess.py
on Google colabs, and I got the following error.Code
It is pretty simple, I installed fairseq on Google Colab and tried to use the
preprocess.py
script.I had installed
fairseq
usingAnd then tried to run the aforementioned script on my text file
What have you tried?
To see if everything was in order I tried simply importing simultaneous_translation as follows
Which also gave me same the error
Environment
!pip install --editable ./