Skip to content

Add en-roa and roa-en Opus-MT translation models - #752

Merged
cristian-tamblay merged 1 commit into
developfrom
feat/opus-mt-romance-translation
Jul 7, 2026
Merged

Add en-roa and roa-en Opus-MT translation models#752
cristian-tamblay merged 1 commit into
developfrom
feat/opus-mt-romance-translation

Conversation

@Irozuku

@Irozuku Irozuku commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes the broken English to Portuguese translation model, which pointed at the nonexistent Helsinki-NLP/opus-mt-en-pt checkpoint (Hugging Face returns 401 for it, so any training/prediction crashed on download). Replaces it with two verified working Opus-MT models that cover Portuguese in both directions, plus other Romance languages.


Type of Change

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

  • DashAI/back/models/hugging_face/opus_mt_en_pt_transformer.py: deleted. Referenced Helsinki-NLP/opus-mt-en-pt, which does not exist on Hugging Face.
  • DashAI/back/models/hugging_face/opus_mt_roa_en_transformer.py: new. Romance to English wrapper (Helsinki-NLP/opus-mt-roa-en, ~74M). Covers Portuguese to English; drop in, reuses the shared training schema, no language token required.
  • DashAI/back/models/hugging_face/opus_mt_en_roa_transformer.py: new. English to Romance wrapper (Helsinki-NLP/opus-mt-en-roa, ~74M). Multi-target with a target_language selector (Portuguese, Spanish, French, Italian, Romanian, Catalan, Galician). Prepends the checkpoint-required >>id<< language token to each source sentence, and persists/restores the chosen language across save/load. All multitarget logic is kept inside this file so the shared OpusMtTransformerMixin stays single pair.
  • DashAI/back/initial_components.py: unregistered OpusMtEnPtTransformer; registered OpusMtEnRoaTransformer and OpusMtRoaEnTransformer.

Testing

  • Train and run a manual prediction preview with opus-mt-en-roa end to end to confirm the save/load roundtrip keeps the language prefix.

Notes

  • The en-roa model requires a target_language, but the shared mixin.load() reconstructs the model without it. Handled by supplying a placeholder during construction and restoring the real value from disk in the model's overridden load(), keeping the mixin untouched.
  • No language token is needed for roa-en since the target is always English; source text (e.g. Portuguese) is fed as is.

Replace the broken en-pt wrapper (pointed at the nonexistent
Helsinki-NLP/opus-mt-en-pt checkpoint) with two working models:

- opus-mt-roa-en: Romance to English (covers pt->en), drop-in.
- opus-mt-en-roa: English to Romance, multi-target with a
  target_language selector; prepends the required >>id<< language
  token to each source sentence. All multi-target handling is kept
  in the model file so the shared OpusMtTransformerMixin stays
  single-pair.
@Irozuku Irozuku added bug Something isn't working back Backend work labels Jul 1, 2026
@cristian-tamblay
cristian-tamblay merged commit ac06c00 into develop Jul 7, 2026
20 checks passed
@cristian-tamblay
cristian-tamblay deleted the feat/opus-mt-romance-translation branch July 7, 2026 12:36
@cristian-tamblay cristian-tamblay mentioned this pull request Aug 6, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back Backend work bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants