Hi
When I try to run the generate.py file and calculate the BLEU score, an ImportError is thrown.
ImportError: cannot import name 'libbleu' from 'fairseq'
Any help would be appreciated.
Hi! You can try cd into the folder containing fairseq's code, and run:
pip install --editable .
did you run the setup?
Running the generate script results in
AttributeError: function 'bleu_zero_init' not found
did you run the setup?
Yes
The BLEU scorer depends on a C module that is compiled when you run python setup.py develop or pip install --editable .. Did that compilation succeed without errors and/or can you try again?
Alternatively you can pip install sacrebleu and pass the --sacrebleu option to generate.py
Most helpful comment
The BLEU scorer depends on a C module that is compiled when you run
python setup.py developorpip install --editable .. Did that compilation succeed without errors and/or can you try again?Alternatively you can
pip install sacrebleuand pass the--sacrebleuoption to generate.py