moofeez commited on
Commit
bcaba34
·
verified ·
1 Parent(s): 7b908c7

RL policy v0 (step 0)

Browse files
adapter_config.json CHANGED
@@ -29,9 +29,9 @@
29
  "rank_pattern": {},
30
  "revision": null,
31
  "target_modules": [
32
- "v_proj",
33
  "q_proj",
34
- "k_proj"
35
  ],
36
  "target_parameters": null,
37
  "task_type": "CAUSAL_LM",
 
29
  "rank_pattern": {},
30
  "revision": null,
31
  "target_modules": [
32
+ "k_proj",
33
  "q_proj",
34
+ "v_proj"
35
  ],
36
  "target_parameters": null,
37
  "task_type": "CAUSAL_LM",
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:19283fcad949983cb320322b9e8f35c739ecfa4dc60f0e6df0f03a53633e2528
3
  size 35644576
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:762c7d6d422de845ee9f58eb3350a8387090d73a5bb05bafb28500ce7dff1a36
3
  size 35644576
chat_template.jinja CHANGED
@@ -1,53 +1,111 @@
1
- {%- if messages[0]['role'] == 'system' %}
2
- {%- set system_message = messages[0]['content'] %}
 
 
 
 
 
 
 
 
 
 
 
 
3
  {%- set loop_messages = messages[1:] %}
4
  {%- else %}
5
  {%- set loop_messages = messages %}
6
- {%- set system_message = '' %}
7
  {%- endif %}
8
- {%- if tools is defined and tools %}
9
- {{- '<|im_start|>system\n' }}
10
- {%- if system_message %}
11
- {{- system_message }}
 
 
 
 
 
 
12
  {%- endif %}
13
- {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
 
 
 
14
  {%- for tool in tools %}
15
- {{- "\n" }}
16
- {{- tool | tojson }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  {%- endfor %}
18
- {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
 
 
 
 
19
  {%- else %}
20
- {%- if system_message %}
21
- {{- '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}
22
  {%- endif %}
23
  {%- endif %}
24
  {%- for message in loop_messages %}
25
- {%- if message.role == "assistant" and message.tool_calls is defined and message.tool_calls %}
26
- {{- '<|im_start|>assistant' }}
27
- {%- if message.content %}
28
- {{- '\n' + message.content }}
29
  {%- endif %}
30
  {%- for tool_call in message.tool_calls %}
31
  {%- if tool_call.function is defined %}
32
  {%- set tool_call = tool_call.function %}
33
  {%- endif %}
34
- {{- '\n<tool_call>\n{"name": "' }}
35
- {{- tool_call.name }}
36
- {{- '", "arguments": ' }}
37
- {%- if tool_call.arguments is string %}
38
- {{- tool_call.arguments }}
39
- {%- else %}
40
- {{- tool_call.arguments | tojson }}
 
41
  {%- endif %}
42
- {{- '}\n</tool_call>' }}
43
  {%- endfor %}
44
  {{- '<|im_end|>\n' }}
 
 
45
  {%- elif message.role == "tool" %}
46
- {%- if loop.previtem is not defined or loop.previtem.role != "tool" %}
47
- {{- '<|im_start|>user' }}
48
  {%- endif %}
49
- {{- '\n<tool_response>\n' + message.content + '\n</tool_response>' }}
50
- {%- if loop.nextitem is not defined or loop.nextitem.role != "tool" %}
 
 
 
 
51
  {{- '<|im_end|>\n' }}
52
  {%- endif %}
53
  {%- else %}
 
1
+ {% macro render_extra_keys(json_dict, handled_keys) %}
2
+ {%- if json_dict is mapping %}
3
+ {%- for json_key in json_dict if json_key not in handled_keys %}
4
+ {%- if json_dict[json_key] is mapping or (json_dict[json_key] is sequence and json_dict[json_key] is not string) %}
5
+ {{- '\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | tojson | safe) ~ '</' ~ json_key ~ '>' }}
6
+ {%- else %}
7
+ {{-'\n<' ~ json_key ~ '>' ~ (json_dict[json_key] | string) ~ '</' ~ json_key ~ '>' }}
8
+ {%- endif %}
9
+ {%- endfor %}
10
+ {%- endif %}
11
+ {% endmacro %}
12
+
13
+ {%- if messages[0]["role"] == "system" %}
14
+ {%- set system_message = messages[0]["content"] %}
15
  {%- set loop_messages = messages[1:] %}
16
  {%- else %}
17
  {%- set loop_messages = messages %}
 
18
  {%- endif %}
19
+
20
+ {%- if not tools is defined %}
21
+ {%- set tools = [] %}
22
+ {%- endif %}
23
+
24
+ {%- if system_message is defined %}
25
+ {{- "<|im_start|>system\n" + system_message }}
26
+ {%- else %}
27
+ {%- if tools is iterable and tools | length > 0 %}
28
+ {{- "<|im_start|>system\nYou are Qwen, a helpful AI assistant that can interact with a computer to solve tasks." }}
29
  {%- endif %}
30
+ {%- endif %}
31
+ {%- if tools is iterable and tools | length > 0 %}
32
+ {{- "\n\n# Tools\n\nYou have access to the following functions:\n\n" }}
33
+ {{- "<tools>" }}
34
  {%- for tool in tools %}
35
+ {%- if tool.function is defined %}
36
+ {%- set tool = tool.function %}
37
+ {%- endif %}
38
+ {{- "\n<function>\n<name>" ~ tool.name ~ "</name>" }}
39
+ {%- if tool.description is defined %}
40
+ {{- '\n<description>' ~ (tool.description | trim) ~ '</description>' }}
41
+ {%- endif %}
42
+ {{- '\n<parameters>' }}
43
+ {%- if tool.parameters is defined and tool.parameters is mapping and tool.parameters.properties is defined and tool.parameters.properties is mapping %}
44
+ {%- for param_name, param_fields in tool.parameters.properties|items %}
45
+ {{- '\n<parameter>' }}
46
+ {{- '\n<name>' ~ param_name ~ '</name>' }}
47
+ {%- if param_fields.type is defined %}
48
+ {{- '\n<type>' ~ (param_fields.type | string) ~ '</type>' }}
49
+ {%- endif %}
50
+ {%- if param_fields.description is defined %}
51
+ {{- '\n<description>' ~ (param_fields.description | trim) ~ '</description>' }}
52
+ {%- endif %}
53
+ {%- set handled_keys = ['name', 'type', 'description'] %}
54
+ {{- render_extra_keys(param_fields, handled_keys) }}
55
+ {{- '\n</parameter>' }}
56
+ {%- endfor %}
57
+ {%- endif %}
58
+ {% set handled_keys = ['type', 'properties'] %}
59
+ {{- render_extra_keys(tool.parameters, handled_keys) }}
60
+ {{- '\n</parameters>' }}
61
+ {%- set handled_keys = ['type', 'name', 'description', 'parameters'] %}
62
+ {{- render_extra_keys(tool, handled_keys) }}
63
+ {{- '\n</function>' }}
64
  {%- endfor %}
65
+ {{- "\n</tools>" }}
66
+ {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
67
+ {%- endif %}
68
+ {%- if system_message is defined %}
69
+ {{- '<|im_end|>\n' }}
70
  {%- else %}
71
+ {%- if tools is iterable and tools | length > 0 %}
72
+ {{- '<|im_end|>\n' }}
73
  {%- endif %}
74
  {%- endif %}
75
  {%- for message in loop_messages %}
76
+ {%- if message.role == "assistant" and message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 %}
77
+ {{- '<|im_start|>' + message.role }}
78
+ {%- if message.content is defined and message.content is string and message.content | trim | length > 0 %}
79
+ {{- '\n' + message.content | trim + '\n' }}
80
  {%- endif %}
81
  {%- for tool_call in message.tool_calls %}
82
  {%- if tool_call.function is defined %}
83
  {%- set tool_call = tool_call.function %}
84
  {%- endif %}
85
+ {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
86
+ {%- if tool_call.arguments is defined %}
87
+ {%- for args_name, args_value in tool_call.arguments|items %}
88
+ {{- '<parameter=' + args_name + '>\n' }}
89
+ {%- set args_value = args_value | tojson | safe if args_value is mapping or (args_value is sequence and args_value is not string) else args_value | string %}
90
+ {{- args_value }}
91
+ {{- '\n</parameter>\n' }}
92
+ {%- endfor %}
93
  {%- endif %}
94
+ {{- '</function>\n</tool_call>' }}
95
  {%- endfor %}
96
  {{- '<|im_end|>\n' }}
97
+ {%- elif message.role == "user" or message.role == "system" or message.role == "assistant" %}
98
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
99
  {%- elif message.role == "tool" %}
100
+ {%- if loop.previtem and loop.previtem.role != "tool" %}
101
+ {{- '<|im_start|>user\n' }}
102
  {%- endif %}
103
+ {{- '<tool_response>\n' }}
104
+ {{- message.content }}
105
+ {{- '\n</tool_response>\n' }}
106
+ {%- if not loop.last and loop.nextitem.role != "tool" %}
107
+ {{- '<|im_end|>\n' }}
108
+ {%- elif loop.last %}
109
  {{- '<|im_end|>\n' }}
110
  {%- endif %}
111
  {%- else %}
meta.json CHANGED
@@ -1,18 +1,18 @@
1
  {
2
- "policy_version": 4,
3
- "global_step": 3,
4
- "timestamp": "2026-07-22T01:15:24.360173",
5
  "model_class": "PeftModelForCausalLM",
6
  "model_name_or_path": "Qwen/Qwen3-Coder-30B-A3B-Instruct",
7
- "training_metrics": {},
 
 
8
  "is_peft_adapter": true,
9
- "requested_model": "/home/hice1/mamjad9/Documents/debugger/llm-debugger/sft/checkpoints/run_july21_v107_ws/peft_adapter",
10
  "base_model_name_or_path": "Qwen/Qwen3-Coder-30B-A3B-Instruct",
11
  "train_lora": true,
12
  "merged_adapter": false,
13
- "frozen_adapter_dir": "/home/hice1/mamjad9/Documents/debugger/llm-debugger/sft/checkpoints/run_july21_v107_ws/peft_adapter",
14
  "frozen_adapter_base_model_name_or_path": "Qwen/Qwen3-Coder-30B-A3B-Instruct",
15
- "rft_adapter_name": "rft",
16
- "update": 3,
17
- "group_key": "GroupKey(v0, pref=optional)"
18
  }
 
1
  {
2
+ "policy_version": 0,
3
+ "global_step": 0,
4
+ "timestamp": "2026-07-28T04:00:44.189401",
5
  "model_class": "PeftModelForCausalLM",
6
  "model_name_or_path": "Qwen/Qwen3-Coder-30B-A3B-Instruct",
7
+ "training_metrics": {
8
+ "initialized": true
9
+ },
10
  "is_peft_adapter": true,
11
+ "requested_model": "/home/hice1/mamjad9/Documents/debugger/llm-debugger/sft/checkpoints/run_july16_B/peft_adapter",
12
  "base_model_name_or_path": "Qwen/Qwen3-Coder-30B-A3B-Instruct",
13
  "train_lora": true,
14
  "merged_adapter": false,
15
+ "frozen_adapter_dir": "/home/hice1/mamjad9/Documents/debugger/llm-debugger/sft/checkpoints/run_july16_B/peft_adapter",
16
  "frozen_adapter_base_model_name_or_path": "Qwen/Qwen3-Coder-30B-A3B-Instruct",
17
+ "rft_adapter_name": "rft"
 
 
18
  }
rft/adapter_config.json CHANGED
@@ -29,9 +29,9 @@
29
  "rank_pattern": {},
30
  "revision": null,
31
  "target_modules": [
32
- "v_proj",
33
  "q_proj",
34
- "k_proj"
35
  ],
36
  "target_parameters": null,
37
  "task_type": "CAUSAL_LM",
 
29
  "rank_pattern": {},
30
  "revision": null,
31
  "target_modules": [
32
+ "k_proj",
33
  "q_proj",
34
+ "v_proj"
35
  ],
36
  "target_parameters": null,
37
  "task_type": "CAUSAL_LM",
rft/adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:19283fcad949983cb320322b9e8f35c739ecfa4dc60f0e6df0f03a53633e2528
3
  size 35644576
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:762c7d6d422de845ee9f58eb3350a8387090d73a5bb05bafb28500ce7dff1a36
3
  size 35644576