File tree Expand file tree Collapse file tree
scripts/generate_tiny_models/for_causal_lm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232tokenizer = AutoTokenizer .from_pretrained (MODEL_ID )
3333generation_config = GenerationConfig .from_pretrained (MODEL_ID )
3434config = 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)
4256model = Cohere2ForCausalLM (config ).to (dtype = torch .bfloat16 )
4357init_weights_tiny_model (model )
You can’t perform that action at this time.
0 commit comments