Skip to content

Fix bug with base NLLB translation #788

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

Merged
merged 2 commits into from
Aug 13, 2025
Merged

Conversation

TaperChipmunk32
Copy link
Collaborator

@TaperChipmunk32 TaperChipmunk32 commented Aug 7, 2025

This PR fixes issue #778, allowing the base NLLB model to translate with the correct language codes.

src_lang and trg_lang are added as arguments for _create_inference_model and _configure model in silnlp.nmt.hugging_face_config.py to set the language codes properly in _configure_model. The test language codes are now used instead of the validation language codes, unless a different code is provided using the --trg-iso or --src-iso options for silnlp.nmt.translate.py


This change is Reviewable

Copy link
Collaborator

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @benjaminking)


silnlp/nmt/hugging_face_config.py line 909 at r1 (raw file):

        # Change specific variables based on the type of model
        model, tokenizer = self._configure_model(
            model, tokenizer, self._config.test_src_lang, self._config.test_trg_lang

During training, we want to use the validation language.

Copy link
Collaborator

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @benjaminking)

@TaperChipmunk32 TaperChipmunk32 merged commit 5f862f0 into master Aug 13, 2025
1 check passed
@TaperChipmunk32 TaperChipmunk32 deleted the issue-778-base-nllb branch August 13, 2025 21:50
@TaperChipmunk32 TaperChipmunk32 linked an issue Aug 13, 2025 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Invalid translations when using the pre-trained NLLB model
2 participants