sshahriyar commited on
Commit
f17c1ad
·
verified ·
1 Parent(s): ce46793

Training in progress, step 100

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,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: EssentialAI/rnj-1-instruct
3
+ library_name: transformers
4
+ model_name: EssentialAI-rnj-1-instruct-trl-grpo
5
+ tags:
6
+ - generated_from_trainer
7
+ - grpo
8
+ - trackio:https://sshahriyar-EssentialAI-rnj-1-instruct-trl-grpo.hf.space?project=huggingface&runs=sshahriyar-1774227545&sidebar=collapsed
9
+ - trl
10
+ licence: license
11
+ ---
12
+
13
+ # Model Card for EssentialAI-rnj-1-instruct-trl-grpo
14
+
15
+ This model is a fine-tuned version of [EssentialAI/rnj-1-instruct](https://huggingface.co/EssentialAI/rnj-1-instruct).
16
+ It has been trained using [TRL](https://github.com/huggingface/trl).
17
+
18
+ ## Quick start
19
+
20
+ ```python
21
+ from transformers import pipeline
22
+
23
+ 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?"
24
+ generator = pipeline("text-generation", model="sshahriyar/EssentialAI-rnj-1-instruct-trl-grpo", device="cuda")
25
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
26
+ print(output["generated_text"])
27
+ ```
28
+
29
+ ## Training procedure
30
+
31
+
32
+ [<img src="https://raw.githubusercontent.com/gradio-app/trackio/refs/heads/main/trackio/assets/badge.png" alt="Visualize in Trackio" title="Visualize in Trackio" width="150" height="24"/>](https://sshahriyar-EssentialAI-rnj-1-instruct-trl-grpo.hf.space?project=huggingface&runs=sshahriyar-1774227545&sidebar=collapsed)
33
+
34
+
35
+ This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://huggingface.co/papers/2402.03300).
36
+
37
+ ### Framework versions
38
+
39
+ - TRL: 0.29.1
40
+ - Transformers: 5.0.0
41
+ - Pytorch: 2.10.0+cu128
42
+ - Datasets: 4.0.0
43
+ - Tokenizers: 0.22.2
44
+
45
+ ## Citations
46
+
47
+ Cite GRPO as:
48
+
49
+ ```bibtex
50
+ @article{shao2024deepseekmath,
51
+ title = {{DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models}},
52
+ author = {Zhihong Shao and Peiyi Wang and Qihao Zhu and Runxin Xu and Junxiao Song and Mingchuan Zhang and Y. K. Li and Y. Wu and Daya Guo},
53
+ year = 2024,
54
+ eprint = {arXiv:2402.03300},
55
+ }
56
+
57
+ ```
58
+
59
+ Cite TRL as:
60
+
61
+ ```bibtex
62
+ @software{vonwerra2020trl,
63
+ title = {{TRL: Transformers Reinforcement Learning}},
64
+ 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},
65
+ license = {Apache-2.0},
66
+ url = {https://github.com/huggingface/trl},
67
+ year = {2020}
68
+ }
69
+ ```
adapter_config.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": {
6
+ "base_model_class": "Gemma3ForCausalLM",
7
+ "parent_library": "transformers.models.gemma3.modeling_gemma3"
8
+ },
9
+ "base_model_name_or_path": "EssentialAI/rnj-1-instruct",
10
+ "bias": "none",
11
+ "corda_config": null,
12
+ "ensure_weight_tying": false,
13
+ "eva_config": null,
14
+ "exclude_modules": null,
15
+ "fan_in_fan_out": false,
16
+ "inference_mode": true,
17
+ "init_lora_weights": true,
18
+ "layer_replication": null,
19
+ "layers_pattern": null,
20
+ "layers_to_transform": null,
21
+ "loftq_config": {},
22
+ "lora_alpha": 32,
23
+ "lora_bias": false,
24
+ "lora_dropout": 0.0,
25
+ "megatron_config": null,
26
+ "megatron_core": "megatron.core",
27
+ "modules_to_save": null,
28
+ "peft_type": "LORA",
29
+ "peft_version": "0.18.1",
30
+ "qalora_group_size": 16,
31
+ "r": 32,
32
+ "rank_pattern": {},
33
+ "revision": null,
34
+ "target_modules": [
35
+ "up_proj",
36
+ "gate_proj",
37
+ "down_proj",
38
+ "v_proj",
39
+ "o_proj",
40
+ "k_proj",
41
+ "q_proj"
42
+ ],
43
+ "target_parameters": null,
44
+ "task_type": null,
45
+ "trainable_token_indices": null,
46
+ "use_dora": false,
47
+ "use_qalora": false,
48
+ "use_rslora": false
49
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7383b39db39d1404fd58f57964818ad4db0455b6ba9ba1b1a88d5c3deb78707b
3
+ size 180415648
chat_template.jinja ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) -%}
2
+ {%- set emit = namespace(started=false) -%}
3
+
4
+ {# ---------- Build base system message (always emitted) ---------- #}
5
+ {%- set base_system = 'You are rnj-1, a foundation model trained by Essential AI.\n' -%}
6
+
7
+ {# ---------- Default system prompt if user system is absent ---------- #}
8
+ {%- set default_system = 'You are a helpful assistant.' -%}
9
+
10
+ {# Detect whether the first message is a user-provided system message #}
11
+ {%- set has_user_system = (messages
12
+ and messages[0].role == 'system'
13
+ and (messages[0].content is string)) -%}
14
+
15
+ {# The system instruction that should apply (user system wins; else default) #}
16
+ {%- set effective_system = (has_user_system and messages[0].content) or default_system -%}
17
+
18
+
19
+ {# ---------- Optional tools preface as a synthetic system message ---------- #}
20
+ {%- if tools %}
21
+ {%- set sys_preamble -%}
22
+ # Tools
23
+
24
+ You may call one or more functions to assist with the user query.
25
+
26
+ You are provided with function signatures within <tools></tools> XML tags:
27
+ <tools>
28
+ {%- for tool in tools %}
29
+ {{ "\n" ~ (tool | tojson) }}
30
+ {% endfor %}
31
+ </tools>
32
+
33
+ For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
34
+ <tool_call>
35
+ {"name": <function-name>, "arguments": <args-json-object>}
36
+ </tool_call>
37
+ {%- endset -%}
38
+
39
+ {# Always include effective_system; user system prevails over default #}
40
+ {%- set sys_content = effective_system ~ "\n\n" ~ sys_preamble -%}
41
+
42
+ {%- set content = '<|start_header_id|>system<|end_header_id|>\n'
43
+ ~ base_system ~ '\n' ~ sys_content ~ '<|eot_id|>' -%}
44
+ {%- if not emit.started -%}{%- set content = bos_token ~ content -%}{%- set emit.started = true -%}{%- endif -%}
45
+ {{- content -}}
46
+ {%- else %}
47
+ {# No tools: always emit base_system + effective_system #}
48
+ {%- set content = '<|start_header_id|>system<|end_header_id|>\n'
49
+ ~ base_system ~ '\n' ~ effective_system ~ '<|eot_id|>' -%}
50
+ {%- if not emit.started -%}{%- set content = bos_token ~ content -%}{%- set emit.started = true -%}{%- endif -%}
51
+ {{- content -}}
52
+ {%- endif -%}
53
+
54
+ {# ---------- Locate last user query for multi-step tool behavior ---------- #}
55
+ {%- for message in messages[::-1] %}
56
+ {%- set index = (messages|length - 1) - loop.index0 -%}
57
+ {%- if ns.multi_step_tool
58
+ and message.role == "user"
59
+ and message.content is string
60
+ and not (message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) -%}
61
+ {%- set ns.multi_step_tool = false -%}
62
+ {%- set ns.last_query_index = index -%}
63
+ {%- endif -%}
64
+ {%- endfor -%}
65
+
66
+ {# ---------- Walk all messages and emit in Llama-3 format ---------- #}
67
+ {%- for message in messages %}
68
+ {%- if message.content is string -%}
69
+ {%- set content = message.content -%}
70
+ {%- else -%}
71
+ {%- set content = '' -%}
72
+ {%- endif -%}
73
+
74
+ {# Skip the FIRST system message if it existed, since we already embedded it in effective_system #}
75
+ {%- if loop.first and message.role == "system" -%}
76
+ {# no-op #}
77
+
78
+ {%- elif (message.role == "user") or (message.role == "system") -%}
79
+ {%- set block = '<|start_header_id|>' ~ message.role ~ '<|end_header_id|>\n' ~ content ~ '<|eot_id|>' -%}
80
+ {%- if not emit.started -%}{%- set block = bos_token ~ block -%}{%- set emit.started = true -%}{%- endif -%}
81
+ {{- block -}}
82
+
83
+ {%- elif message.role == "assistant" -%}
84
+ {%- set body = content -%}
85
+ {%- set header = '<|start_header_id|>assistant<|end_header_id|>\n' -%}
86
+ {%- if not emit.started -%}{{ bos_token }}{%- set emit.started = true -%}{%- endif -%}
87
+ {{- header -}}
88
+ {% generation %}
89
+ {{- body -}}
90
+ {%- if message.tool_calls -%}
91
+ {%- for tool_call in message.tool_calls -%}
92
+ {%- if tool_call.function -%}{%- set tc = tool_call.function -%}{%- else -%}{%- set tc = tool_call -%}{%- endif -%}
93
+ {%- set args_json = (tc.arguments if (tc.arguments is string) else (tc.arguments | tojson)) -%}
94
+ {%- if loop.first -%}
95
+ {{- '<tool_call>\n{"name": "' ~ tc.name ~ '", "arguments": ' ~ args_json ~ '}\n</tool_call>' -}}
96
+ {%- else -%}
97
+ {{- '\n<tool_call>\n{"name": "' ~ tc.name ~ '", "arguments": ' ~ args_json ~ '}\n</tool_call>' -}}
98
+ {%- endif -%}
99
+ {%- endfor -%}
100
+ {%- endif -%}
101
+ {{- '<|eot_id|>' -}}{%- endgeneration -%}
102
+
103
+ {%- elif message.role == "tool" -%}
104
+ {%- set open_user = (loop.first or (loop.index0 > 0 and messages[loop.index0 - 1].role != "tool")) -%}
105
+ {%- set close_user = (loop.last or (loop.index0 < messages|length - 1 and messages[loop.index0 + 1].role != "tool")) -%}
106
+
107
+ {%- if open_user -%}
108
+ {%- set header = '<|start_header_id|>user<|end_header_id|>\n' -%}
109
+ {%- if not emit.started -%}{%- set header = bos_token ~ header -%}{%- set emit.started = true -%}{%- endif -%}
110
+ {{- header -}}
111
+ {%- endif -%}
112
+ {%- if open_user -%}
113
+ {{- '<tool_response>\n' -}}
114
+ {%- else -%}
115
+ {{- '\n<tool_response>\n' -}}
116
+ {%- endif -%}
117
+ {{- content -}}
118
+ {{- '\n</tool_response>' -}}
119
+
120
+ {%- if close_user -%}
121
+ {{- '<|eot_id|>' -}}
122
+ {%- endif -%}
123
+ {%- endif -%}
124
+ {%- endfor -%}
125
+
126
+ {%- if add_generation_prompt -%}
127
+ {{- '<|start_header_id|>assistant<|end_header_id|>\n' -}}
128
+ {%- endif -%}
completions/completions_00010.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12a078c8984e8ef94a2eb680cbeb7dbf9d04b8d7c6e68319f707164ad38b1383
3
+ size 15618
completions/completions_00020.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:afe7b1de6d07668e929fb0fcb3e85ba14eebf362d98c152c3345fd87d3372ade
3
+ size 12560
completions/completions_00030.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68b1563023baf313c28d3edc55c78945342f9d6a391a891a2a0b73f935c0a4db
3
+ size 15552
completions/completions_00040.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74dc63bda4974e87e24d6cdda6e8651f407e09f699a679e1f1fafaf37d59cd25
3
+ size 18535
completions/completions_00050.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7d239aeef54712b955aa8bd331ccb2b416c28cb2446642b15704fbc8a468349a
3
+ size 16521
completions/completions_00060.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7eb42209a738db7731485ae800884cd1a7d4f88ccceacbd433129c89926d1b2
3
+ size 15597
completions/completions_00070.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f19545133f9fc4cecac0a3cff74644a67d648f4f5156dd2addc3fa4f08176634
3
+ size 14580
completions/completions_00080.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec6db18ef78d8fe351b2ea67f1769579e0dbe39f92d95d148b03c5b8d1026456
3
+ size 16307
completions/completions_00090.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63b3d612e6fe5919c48e85e9a9e4bc5b8c66d03b994ef91d83e0384c82171fe9
3
+ size 16128
completions/completions_00100.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:668679e7e8ff25ff5b30245d2e134c0d7930f9b9e7f5d8a56f0f8646fafc667b
3
+ size 17857
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab582c0b82ff7af759c87d6c859f06e7601851e41c1fc18d730e0c452270f992
3
+ size 17209964
tokenizer_config.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "bos_token": "<|begin_of_text|>",
4
+ "clean_up_tokenization_spaces": true,
5
+ "eos_token": "<|end_of_text|>",
6
+ "is_local": false,
7
+ "model_input_names": [
8
+ "input_ids",
9
+ "attention_mask"
10
+ ],
11
+ "model_max_length": 1000000000000000019884624838656,
12
+ "model_specific_special_tokens": {},
13
+ "pad_token": "<|end_of_text|>",
14
+ "padding_side": "left",
15
+ "tokenizer_class": "TokenizersBackend",
16
+ "truncation_side": "left"
17
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f9ee75c034feeb5d76b9cb5bd544d6eb3ea19f362f9c9382d8eb395169af6ef
3
+ size 6929