Skip to content

Commit fc904f6

Browse files
authored
Align tiny Cohere2 config with tiny-aya-earth (#5707)
1 parent cdf31e9 commit fc904f6

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

scripts/generate_tiny_models/for_causal_lm/cohere2_for_causal_lm.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,26 @@
3232
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
3333
generation_config = GenerationConfig.from_pretrained(MODEL_ID)
3434
config = Cohere2Config(
35-
vocab_size=len(tokenizer.vocab),
35+
vocab_size=262144,
3636
hidden_size=8,
3737
num_attention_heads=4,
3838
num_key_value_heads=2,
3939
num_hidden_layers=2,
4040
intermediate_size=32,
41+
logit_scale=1.0,
42+
rope_theta=50000,
43+
bos_token_id=2,
44+
eos_token_id=3,
45+
cache_implementation="hybrid",
46+
layer_switch=4,
47+
order_of_interleaved_layers="local_attn_first",
48+
position_embedding_type="rope_gptj",
49+
rotary_pct=1.0,
50+
use_embedding_sharing=True,
51+
use_gated_activation=True,
52+
use_parallel_block=True,
53+
use_parallel_embedding=False,
54+
use_qk_norm=False,
4155
)
4256
model = Cohere2ForCausalLM(config).to(dtype=torch.bfloat16)
4357
init_weights_tiny_model(model)

0 commit comments

Comments
 (0)