Skip to content

Commit

Permalink
check alignment_heads in gen config before using (#1565)
Browse files Browse the repository at this point in the history
Co-authored-by: thucpham <[email protected]>
  • Loading branch information
minhthuc2502 and thucpham authored Nov 28, 2023
1 parent d963499 commit 72da51f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/ctranslate2/converters/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,8 @@ def set_config(self, config, model, tokenizer):
if gen_config is not None:
config.suppress_ids = gen_config.suppress_tokens
config.suppress_ids_begin = gen_config.begin_suppress_tokens
config.alignment_heads = gen_config.alignment_heads
if hasattr(gen_config, "alignment_heads"):
config.alignment_heads = gen_config.alignment_heads
if hasattr(gen_config, "lang_to_id"):
config.lang_ids = sorted(gen_config.lang_to_id.values())
else:
Expand Down

0 comments on commit 72da51f

Please sign in to comment.