Skip to content

Commit

Permalink
Make attn_implementation configurable for huggingface models (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac091 authored Jan 14, 2025
1 parent 9110963 commit 6de035f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion machine/jobs/huggingface/hugging_face_nmt_model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ def init(self) -> None:
)
self._model = cast(
PreTrainedModel,
AutoModelForSeq2SeqLM.from_pretrained(self._config.huggingface.parent_model_name, config=config),
AutoModelForSeq2SeqLM.from_pretrained(
self._config.huggingface.parent_model_name,
config=config,
attn_implementation=self._config.huggingface.attn_implementation,
),
)

def create_source_tokenizer_trainer(self, corpus: TextCorpus) -> Trainer:
Expand Down
1 change: 1 addition & 0 deletions machine/jobs/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ default:
tokenizer:
add_unk_src_tokens: true
add_unk_trg_tokens: true
attn_implementation: sdpa
thot_mt:
word_alignment_model_type: hmm
tokenizer: latin
Expand Down

0 comments on commit 6de035f

Please sign in to comment.