Upload Lfm2ForCausalLM

#1
by albertvillanova HF Staff - opened
Files changed (3) hide show
  1. chat_template.jinja +4 -2
  2. config.json +20 -1
  3. model.safetensors +1 -1
chat_template.jinja CHANGED
@@ -75,8 +75,10 @@
75
  {{- "<|im_start|>" + message.role + "\n" -}}
76
  {%- if message.role == "assistant" -%}
77
  {%- generation -%}
78
- {%- if message.thinking is defined and (preserve_thinking or loop.index0 > ns.last_user_index) -%}
79
- {{- "<think>" + message.thinking + "</think>" -}}
 
 
80
  {%- endif -%}
81
  {%- set _cfm_tag = "CONTINUE_FINAL_MESSAGE_TAG " -%}
82
  {%- set _has_cfm = false -%}
 
75
  {{- "<|im_start|>" + message.role + "\n" -}}
76
  {%- if message.role == "assistant" -%}
77
  {%- generation -%}
78
+ {%- set thinking = message.thinking or message.reasoning or message.reasoning_content -%}
79
+ {%- set thinking = thinking if thinking is string else "" -%}
80
+ {%- if thinking and (preserve_thinking or loop.index0 > ns.last_user_index) -%}
81
+ {{- "<think>" + thinking + "</think>" -}}
82
  {%- endif -%}
83
  {%- set _cfm_tag = "CONTINUE_FINAL_MESSAGE_TAG " -%}
84
  {%- set _has_cfm = false -%}
config.json CHANGED
@@ -2,14 +2,29 @@
2
  "architectures": [
3
  "Lfm2ForCausalLM"
4
  ],
 
5
  "block_auto_adjust_ff_dim": false,
 
 
6
  "block_ffn_dim_multiplier": 1.0,
 
 
 
7
  "block_multiple_of": 256,
 
 
 
 
 
8
  "bos_token_id": 1,
9
  "conv_L_cache": 3,
10
  "conv_bias": false,
 
 
11
  "dtype": "bfloat16",
12
  "eos_token_id": 7,
 
 
13
  "hidden_size": 8,
14
  "initializer_range": 0.02,
15
  "intermediate_size": 32,
@@ -21,6 +36,7 @@
21
  "model_type": "lfm2",
22
  "norm_eps": 1e-05,
23
  "num_attention_heads": 4,
 
24
  "num_hidden_layers": 2,
25
  "num_key_value_heads": 2,
26
  "pad_token_id": 0,
@@ -28,8 +44,11 @@
28
  "rope_theta": 1000000.0,
29
  "rope_type": "default"
30
  },
 
 
31
  "tie_word_embeddings": true,
32
  "transformers_version": "5.0.0",
33
- "use_cache": false,
 
34
  "vocab_size": 65536
35
  }
 
2
  "architectures": [
3
  "Lfm2ForCausalLM"
4
  ],
5
+ "block__name_mlp": "parallel_mlp_merged",
6
  "block_auto_adjust_ff_dim": false,
7
+ "block_dim": 8,
8
+ "block_ff_dim": 32,
9
  "block_ffn_dim_multiplier": 1.0,
10
+ "block_ffn_te_autocast": false,
11
+ "block_ffn_use_quantized_params": false,
12
+ "block_mlp_init_scale": 1.0,
13
  "block_multiple_of": 256,
14
+ "block_norm_eps": 1e-05,
15
+ "block_out_init_scale": 1.0,
16
+ "block_sequence_parallel_norm_across_tp": false,
17
+ "block_use_swiglu": true,
18
+ "block_use_xavier_init": true,
19
  "bos_token_id": 1,
20
  "conv_L_cache": 3,
21
  "conv_bias": false,
22
+ "conv_dim": 8,
23
+ "conv_use_xavier_init": true,
24
  "dtype": "bfloat16",
25
  "eos_token_id": 7,
26
+ "ffn_te_autocast": false,
27
+ "ffn_use_quantized_params": false,
28
  "hidden_size": 8,
29
  "initializer_range": 0.02,
30
  "intermediate_size": 32,
 
36
  "model_type": "lfm2",
37
  "norm_eps": 1e-05,
38
  "num_attention_heads": 4,
39
+ "num_heads": 4,
40
  "num_hidden_layers": 2,
41
  "num_key_value_heads": 2,
42
  "pad_token_id": 0,
 
44
  "rope_theta": 1000000.0,
45
  "rope_type": "default"
46
  },
47
+ "sequence_parallel_norm_across_tp": false,
48
+ "tie_embedding": true,
49
  "tie_word_embeddings": true,
50
  "transformers_version": "5.0.0",
51
+ "use_cache": true,
52
+ "use_pos_enc": true,
53
  "vocab_size": 65536
54
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ce2d332095a2ca14ad26573a9b50a8be2a0445be817c187e5b9701b347aadbaa
3
  size 1054864
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75b4a6eb993c7f2777ee0621be1e667a72bfeee9b23bc3ede333c45135ab668d
3
  size 1054864