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

spm_encode not found #10

Closed
sandeep2244 opened this issue Jul 6, 2023 · 3 comments
Closed

spm_encode not found #10

sandeep2244 opened this issue Jul 6, 2023 · 3 comments

Comments

@sandeep2244
Copy link

Hey,

I did clone and ran model with input text and expecting ouput in english, I downloaded model on my local mac m2 pro

Getting below error
joint_translate.sh: line 48: spm_encode: command not found

Command i ran is below
bash joint_translate.sh input op hin_Deva eng_Latn ../../../Downloads/indic-en-deploy/fairseq_model

Can you please help me to how i can export spm_encode

I exported it with SPM_PATH but no chance.

@PranjalChitale
Copy link
Collaborator

https://github.com/AI4Bharat/IndicTrans2/blob/main/install.sh#L46

As mentioned in install.sh, in order to use spm_encode from the command line, you need to build the cpp binaries from the source repo.

Please refer to the sentencepiece github repository link and follow the steps there, post this is done, the above issue should be resolved.

@sandeep2244
Copy link
Author

sandeep2244 commented Jul 6, 2023

@PranjalChitale , Thank you for the quick response, Issue resolved.

It's running successful with no error.

image

Now checking output.txt file is blank file with same number of blank lines as a input number of line.

Hindi to English AND English to English also get output blank.

I see output.txt.log has below errors

  File "/opt/homebrew/lib/python3.11/site-packages/fairseq/dataclass/configs.py", line 1127, in <module>
    @dataclass
     ^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'fairseq.dataclass.configs.CommonConfig'> for field common is not allowed: use default_factory

May be due to above errors log , it's not translating or something else is missing.

EDIT 1: Running python inference working fine , generating output, issue is only from above command.

@PranjalChitale
Copy link
Collaborator

@sandeep2244

facebookresearch/fairseq#5012

^ Please create a new environment with Python 3.9 and this should be resolved.

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

2 participants