AlirezaSakhaei commited on
Commit
0b7de8e
·
verified ·
1 Parent(s): bfe8331

Training in progress, step 500

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: LiquidAI/LFM2.5-8B-A1B-Base
3
+ library_name: transformers
4
+ model_name: lfm25-8b-a1b-pv-extraversion-high
5
+ tags:
6
+ - generated_from_trainer
7
+ - trl
8
+ - sft
9
+ licence: license
10
+ ---
11
+
12
+ # Model Card for lfm25-8b-a1b-pv-extraversion-high
13
+
14
+ This model is a fine-tuned version of [LiquidAI/LFM2.5-8B-A1B-Base](https://huggingface.co/LiquidAI/LFM2.5-8B-A1B-Base).
15
+ It has been trained using [TRL](https://github.com/huggingface/trl).
16
+
17
+ ## Quick start
18
+
19
+ ```python
20
+ from transformers import pipeline
21
+
22
+ question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
23
+ generator = pipeline("text-generation", model="PersonaPO/lfm25-8b-a1b-pv-extraversion-high", device="cuda")
24
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
25
+ print(output["generated_text"])
26
+ ```
27
+
28
+ ## Training procedure
29
+
30
+ [<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/alirezasakhaeirad/personapo/runs/nadjl08b)
31
+
32
+
33
+
34
+ This model was trained with SFT.
35
+
36
+ ### Framework versions
37
+
38
+ - TRL: 1.5.1
39
+ - Transformers: 5.11.0
40
+ - Pytorch: 2.12.0
41
+ - Datasets: 5.0.0
42
+ - Tokenizers: 0.22.2
43
+
44
+ ## Citations
45
+
46
+
47
+
48
+ Cite TRL as:
49
+
50
+ ```bibtex
51
+ @software{vonwerra2020trl,
52
+ title = {{TRL: Transformers Reinforcement Learning}},
53
+ author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
54
+ license = {Apache-2.0},
55
+ url = {https://github.com/huggingface/trl},
56
+ year = {2020}
57
+ }
58
+ ```
chat_template.jinja ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{- bos_token -}}
2
+ {%- set preserve_thinking = preserve_thinking | default(false) -%}
3
+
4
+ {%- macro format_arg_value(arg_value) -%}
5
+ {%- if arg_value is string -%}
6
+ {{- "'" + arg_value + "'" -}}
7
+ {%- elif arg_value is mapping -%}
8
+ {{- arg_value | tojson -}}
9
+ {%- else -%}
10
+ {{- arg_value | string -}}
11
+ {%- endif -%}
12
+ {%- endmacro -%}
13
+
14
+ {%- macro parse_content(content) -%}
15
+ {%- if content is string -%}
16
+ {{- content -}}
17
+ {%- else -%}
18
+ {%- set _ns = namespace(result="") -%}
19
+ {%- for item in content -%}
20
+ {%- if item["type"] == "image" -%}
21
+ {%- set _ns.result = _ns.result + "<image>" -%}
22
+ {%- elif item["type"] == "text" -%}
23
+ {%- set _ns.result = _ns.result + item["text"] -%}
24
+ {%- else -%}
25
+ {%- set _ns.result = _ns.result + item | tojson -%}
26
+ {%- endif -%}
27
+ {%- endfor -%}
28
+ {{- _ns.result -}}
29
+ {%- endif -%}
30
+ {%- endmacro -%}
31
+
32
+ {%- macro render_tool_calls(tool_calls) -%}
33
+ {%- set tool_calls_ns = namespace(tool_calls=[]) -%}
34
+ {%- for tool_call in tool_calls -%}
35
+ {%- set func_name = tool_call["function"]["name"] -%}
36
+ {%- set func_args = tool_call["function"]["arguments"] -%}
37
+ {%- set args_ns = namespace(arg_strings=[]) -%}
38
+ {%- for arg_name, arg_value in func_args.items() -%}
39
+ {%- set args_ns.arg_strings = args_ns.arg_strings + [arg_name + "=" + format_arg_value(arg_value)] -%}
40
+ {%- endfor -%}
41
+ {%- set tool_calls_ns.tool_calls = tool_calls_ns.tool_calls + [func_name + "(" + (args_ns.arg_strings | join(", ")) + ")"] -%}
42
+ {%- endfor -%}
43
+ {{- "<|tool_call_start|>[" + (tool_calls_ns.tool_calls | join(", ")) + "]<|tool_call_end|>" -}}
44
+ {%- endmacro -%}
45
+
46
+ {%- set ns = namespace(system_prompt="", last_user_index=-1) -%}
47
+ {%- if messages[0]["role"] == "system" -%}
48
+ {%- if messages[0].get("content") -%}
49
+ {%- set ns.system_prompt = parse_content(messages[0]["content"]) -%}
50
+ {%- endif -%}
51
+ {%- set messages = messages[1:] -%}
52
+ {%- endif -%}
53
+ {%- if tools -%}
54
+ {%- set ns.system_prompt = ns.system_prompt + ("\n\n" if ns.system_prompt else "") + "Today's date: " + strftime_now("%Y-%m-%d") + "\n\nList of tools: " + (tools | tojson) -%}
55
+ {%- endif -%}
56
+ {%- if ns.system_prompt -%}
57
+ {{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
58
+ {%- endif -%}
59
+ {%- for message in messages -%}
60
+ {%- if message["role"] == "user" -%}
61
+ {%- set ns.last_user_index = loop.index0 -%}
62
+ {%- endif -%}
63
+ {%- endfor -%}
64
+ {%- for message in messages -%}
65
+ {{- "<|im_start|>" + message.role + "\n" -}}
66
+ {%- if message.role == "assistant" -%}
67
+ {%- generation -%}
68
+ {%- if message.thinking is defined and (preserve_thinking or loop.index0 > ns.last_user_index) -%}
69
+ {{- "<think>" + message.thinking + "</think>" -}}
70
+ {%- endif -%}
71
+ {%- set _cfm_tag = "CONTINUE_FINAL_MESSAGE_TAG " -%}
72
+ {%- set _has_cfm = false -%}
73
+ {%- if message.content is defined -%}
74
+ {%- set content = parse_content(message.content) -%}
75
+ {%- if not (preserve_thinking or loop.index0 > ns.last_user_index) -%}
76
+ {%- if "</think>" in content -%}
77
+ {%- set content = content.split("</think>")[-1] | trim -%}
78
+ {%- endif -%}
79
+ {%- endif -%}
80
+ {%- if message.tool_calls is defined and content.endswith(_cfm_tag) -%}
81
+ {%- set _has_cfm = true -%}
82
+ {%- set _trunc_len = (content | length) - (_cfm_tag | length) -%}
83
+ {{- content[:_trunc_len] -}}
84
+ {%- else -%}
85
+ {{- content -}}
86
+ {%- endif -%}
87
+ {%- endif -%}
88
+ {%- if message.tool_calls is defined -%}
89
+ {{- render_tool_calls(message.tool_calls) -}}
90
+ {%- endif -%}
91
+ {%- if _has_cfm -%}
92
+ {{- _cfm_tag -}}
93
+ {%- endif -%}
94
+ {{- "<|im_end|>\n" -}}
95
+ {%- endgeneration -%}
96
+ {%- else %}
97
+ {%- if message.get("content") -%}
98
+ {{- parse_content(message["content"]) -}}
99
+ {%- endif -%}
100
+ {{- "<|im_end|>\n" -}}
101
+ {%- endif %}
102
+ {%- endfor -%}
103
+ {%- if add_generation_prompt -%}
104
+ {{- "<|im_start|>assistant\n" -}}
105
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Lfm2MoeForCausalLM"
4
+ ],
5
+ "bos_token_id": 124894,
6
+ "conv_L_cache": 3,
7
+ "conv_bias": false,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": 124900,
10
+ "hidden_size": 2048,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 7168,
13
+ "layer_types": [
14
+ "conv",
15
+ "conv",
16
+ "full_attention",
17
+ "conv",
18
+ "conv",
19
+ "conv",
20
+ "full_attention",
21
+ "conv",
22
+ "conv",
23
+ "conv",
24
+ "full_attention",
25
+ "conv",
26
+ "conv",
27
+ "conv",
28
+ "full_attention",
29
+ "conv",
30
+ "conv",
31
+ "conv",
32
+ "full_attention",
33
+ "conv",
34
+ "conv",
35
+ "full_attention",
36
+ "conv",
37
+ "conv"
38
+ ],
39
+ "max_position_embeddings": 128000,
40
+ "model_type": "lfm2_moe",
41
+ "moe_intermediate_size": 1792,
42
+ "norm_eps": 1e-05,
43
+ "norm_topk_prob": true,
44
+ "num_attention_heads": 32,
45
+ "num_dense_layers": 2,
46
+ "num_experts": 32,
47
+ "num_experts_per_tok": 4,
48
+ "num_hidden_layers": 24,
49
+ "num_key_value_heads": 8,
50
+ "pad_token_id": 124893,
51
+ "rope_parameters": {
52
+ "rope_theta": 1000000.0,
53
+ "rope_type": "default"
54
+ },
55
+ "routed_scaling_factor": 1.0,
56
+ "tie_word_embeddings": true,
57
+ "transformers_version": "5.11.0",
58
+ "use_cache": false,
59
+ "use_expert_bias": true,
60
+ "vocab_size": 128000
61
+ }
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 124894,
4
+ "eos_token_id": [
5
+ 124900
6
+ ],
7
+ "output_attentions": false,
8
+ "output_hidden_states": false,
9
+ "pad_token_id": 124893,
10
+ "transformers_version": "5.11.0",
11
+ "use_cache": true
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00b9258bb5ddec4d6df8296849915373c2d96d901647601fc69bcf501e88bac0
3
+ size 16936006912
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4687c0046da6579aba6f9aa713e9bed61e5fd210b0e012028ae57751d028689
3
+ size 17905589
tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|startoftext|>",
4
+ "clean_up_tokenization_spaces": false,
5
+ "eos_token": "<|im_end|>",
6
+ "is_local": false,
7
+ "legacy": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "<|pad|>",
11
+ "tokenizer_class": "TokenizersBackend",
12
+ "use_default_system_prompt": false
13
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6d1cd29f6c0126d890769e1f9ee31a3ed042ea9ab99a84ae97624f9d15323f1
3
+ size 5713