You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(translators): add M2M100HF translator (Nvidia CUDA / AMD ROCm)
Adds two new offline translator variants using HuggingFace transformers
directly instead of ctranslate2, enabling AMD ROCm support.
New translator keys:
m2m100_hf — facebook/m2m100_418M
m2m100_hf_big — facebook/m2m100_1.2B
Changes:
- manga_translator/translators/m2m100_hf.py (new)
- manga_translator/config.py: add m2m100_hf / m2m100_hf_big to Translator enum
- manga_translator/translators/__init__.py: register in OFFLINE_TRANSLATORS
- README.md: add entries to translator reference table and JSON schema enum
Implementation details:
- Uses AutoModelForSeq2SeqLM + AutoTokenizer directly (no pipeline-per-sentence)
- Model moved to device via .to(device) — works on Nvidia CUDA, AMD ROCm, CPU
- Auto language detection via langdetect on the full batch
- Falls back to '' on unrecoverable errors
- _check_downloaded checks both model.safetensors and pytorch_model.bin
Co-authored-by: GitHub Copilot <github-copilot[bot]@users.noreply.github.com>
0 commit comments