Skip to content

Reduce re-loading huggingface tokenizers and models#35

Merged
laurejt merged 1 commit intodevelopfrom
feature/speed-up-translation
Feb 20, 2026
Merged

Reduce re-loading huggingface tokenizers and models#35
laurejt merged 1 commit intodevelopfrom
feature/speed-up-translation

Conversation

@laurejt
Copy link

@laurejt laurejt commented Feb 20, 2026

Associated Issue(s): None

Changes in this PR

  • Added a workaround to translate.py so that consecutive translation calls with the same model will only load that tokenizer and model once

Notes

  • This workaround is not ideal, but should be okay in the short-term / for this experimental phase

Reviewer Checklist

  • Check that translate_corpus.py runs successfully for HuggingFace models (i.e., hymt, madlad, nllb)
  • Confirm that translate_corpus.py only sends HTTP requests to HuggingFace for the first translation. Use --verbose to observe this behavior.

@laurejt laurejt requested a review from tanhaow February 20, 2026 20:50
@laurejt laurejt self-assigned this Feb 20, 2026
@laurejt laurejt changed the title Add reuse last loaded HuggingFace model/tokenizer Reduce re-loading huggingface tokenizers and models Feb 20, 2026
Copy link

@tanhaow tanhaow left a comment

Choose a reason for hiding this comment

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

🚀

@laurejt laurejt merged commit e36059c into develop Feb 20, 2026
1 check passed
@laurejt laurejt deleted the feature/speed-up-translation branch February 20, 2026 21:08
@laurejt laurejt added the 👇this sprint Add Issue to ZenHub label Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👇this sprint Add Issue to ZenHub

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants