Skip to content

Commit

Permalink
add options
Browse files Browse the repository at this point in the history
  • Loading branch information
vince62s committed Dec 16, 2024
1 parent 09e1a78 commit acc9a51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/ctranslate2/converters/eole_ct2.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,25 @@ def _get_model_spec_seq2seq(
alignment_heads = config.decoder.alignment_heads

num_heads = getattr(config.decoder, "heads", 8)
num_kv = getattr(config.decoder, "heads_kv", 0)
if num_kv == num_heads or num_kv == 0:
num_kv = None
rotary_dim = 0 if with_rotary else None
rotary_interleave = getattr(config.rope_config, "rotary_interleave", True)
ffn_glu = activation_fn == "gated-silu"
sliding_window = getattr(config, "sliding_window", 0)

model_spec = transformer_spec.TransformerSpec.from_config(
(config.encoder.layers, config.decoder.layers),
num_heads,
with_relative_position=with_relative_position,
alibi=with_alibi,
activation=_SUPPORTED_ACTIVATIONS[activation_fn],
rms_norm=config.layer_norm == "rms",
rotary_dim=rotary_dim,
rotary_interleave=rotary_interleave,
num_heads_kv=num_kv,
sliding_window=sliding_window,
alignment_layer=alignment_layer,
alignment_heads=alignment_heads,
num_source_embeddings=num_source_embeddings,
Expand Down

0 comments on commit acc9a51

Please sign in to comment.