bebis1 commited on
Commit
63bdbf7
·
verified ·
1 Parent(s): 566a5fb

Upload HyperLLM v0.2

Browse files
README.md CHANGED
@@ -1,140 +1,191 @@
1
  ---
2
  base_model: Qwen/Qwen3-4B-Instruct-2507
3
  library_name: peft
4
- license: apache-2.0
5
- pipeline_tag: text-generation
 
6
  tags:
7
- - lora
8
- - sft
9
  - trading
10
  - hyperliquid
11
- - position-sizing
12
- - finance
13
- language:
14
- - en
 
 
 
15
  ---
16
 
17
- # HyperLLM-4b-0.1
18
-
19
- A LoRA fine-tune of [Qwen3-4B-Instruct](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507) specialized for position sizing calculations, parameter validation, and API operations on the [Hyperliquid](https://hyperliquid.xyz) decentralized exchange.
20
 
21
- > **Note:** This is an experimental pre-release (0.1). Known issues include parameter validation regression. See [Limitations](#limitations).
22
 
23
  ## Model Description
24
 
25
- HyperLLM-4b-0.1 is a domain-adapted assistant for cryptocurrency trading on Hyperliquid. It is designed to:
26
-
27
- - **Calculate position sizes** based on account balance, risk percentage, entry price, and stop loss
28
- - **Validate trading parameters** against exchange constraints (lot sizes, leverage limits, price precision)
29
- - **Generate correctly formatted API calls** for Hyperliquid's REST and WebSocket APIs
30
- - **Answer questions** about Hyperliquid mechanics, margin modes, and order types
31
-
32
- This model is designed to sit within a harness - It provides recommendations that should be validated by application-layer safety checks and human oversight.
33
-
34
- ## Intended Use
35
-
36
- - Position sizing calculations for risk-managed trading
37
- - Parameter validation before order submission
38
- - API call generation for Hyperliquid integration
39
- - Educational tool for understanding Hyperliquid mechanics
40
-
41
- ## Out-of-Scope Use
42
-
43
- - Autonomous trade execution without human oversight
44
- - Financial advice or investment recommendations
45
- - Use with exchanges other than Hyperliquid (parameters are exchange-specific)
46
-
47
- ## Training Results
48
-
49
- | Category | Baseline | Trained | Change |
50
- |----------|----------|---------|--------|
51
- | Overall | 36% | 64% | +28% |
52
- | Trading Mechanics | 20% | 80% | +60% |
53
- | Factual Knowledge | 60% | 80% | +20% |
54
- | API Structure | 17% | 50% | +33% |
55
- | Parameter Validation | 75% | 50% | -25% |
56
-
57
- > **Note:** Parameter validation regressed due to data imbalance in v1 training. This is addressed in subsequent versions.
 
 
58
 
59
  ## Training Details
60
 
61
- - **Base Model:** Qwen/Qwen3-4B-Instruct-2507
62
- - **Method:** QLoRA (4-bit quantization + LoRA)
63
- - **LoRA Rank:** 32
64
- - **LoRA Alpha:** 64
65
- - **Training Examples:** ~2,400 synthetic examples
66
- - **Categories:** Position sizing, API examples, knowledge Q&A, adversarial percentages
67
- - **Hardware:** NVIDIA RTX 3080 (12GB VRAM)
68
- - **Training Time:** ~3 hours
69
-
70
- ## How to Use
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  ```python
73
- from transformers import AutoModelForCausalLM, AutoTokenizer
74
  from peft import PeftModel
 
 
 
 
 
 
 
 
75
 
76
- # Load base model
77
  base_model = AutoModelForCausalLM.from_pretrained(
78
  "Qwen/Qwen3-4B-Instruct-2507",
79
- torch_dtype="auto",
80
  device_map="auto",
81
- trust_remote_code=True
82
- )
83
- tokenizer = AutoTokenizer.from_pretrained(
84
- "Qwen/Qwen3-4B-Instruct-2507",
85
- trust_remote_code=True
86
  )
87
 
88
  # Load LoRA adapter
89
- model = PeftModel.from_pretrained(base_model, "UVLabs/HyperLLM-4b-0.1")
 
 
 
 
 
 
90
 
91
- # Example: Position sizing calculation
92
  messages = [
93
- {"role": "system", "content": "You are a trading assistant for Hyperliquid. Calculate position sizes accurately and validate parameters against exchange constraints."},
94
- {"role": "user", "content": "Account: $50,000, Risk: 2%, Entry: $45,000, Stop: $43,000. What is the correct position size for BTC?"}
95
  ]
96
 
97
  text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
98
  inputs = tokenizer(text, return_tensors="pt").to(model.device)
99
- outputs = model.generate(**inputs, max_new_tokens=512)
 
100
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
101
  ```
102
 
103
- ## Limitations
 
 
 
 
104
 
105
- - **Exchange-specific:** Trained on Hyperliquid data only; parameters may not apply to other exchanges
106
- - **Parameter validation regression:** v1 showed decreased accuracy on parameter validation (addressed in later versions)
107
- - **Not financial advice:** Outputs should be validated before use in live trading
108
- - **Requires safety layer:** Should be deployed with application-level position limits and human confirmation for large trades
 
 
 
 
109
 
110
- ## Risks and Recommendations
111
 
112
- 1. **Always validate calculations** before executing trades
113
- 2. **Implement hard limits** in your application layer (e.g., max 10% position size, max 10x leverage)
114
- 3. **Require human confirmation** for trades exceeding risk thresholds
115
- 4. **Paper trade first** before using with real capital
116
 
117
- ## License
118
 
119
- This model is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0), consistent with the base Qwen3 model license.
 
 
 
120
 
121
- ### Qwen3 License Notice
122
 
123
- This model is a derivative of Qwen3-4B-Instruct, which is released under Apache 2.0 by Alibaba Cloud. See the [Qwen3 model card](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507) for full details.
124
 
125
  ## Citation
126
 
127
  ```bibtex
128
  @misc{hyperllm2026,
129
- title={HyperLLM: Domain-Adapted LLM for Hyperliquid Trading},
130
- author={HyperLLM Team},
131
  year={2026},
132
- url={https://huggingface.co/UVLabs/HyperLLM-4b-0.1}
 
133
  }
134
  ```
135
 
136
- ## Version History
137
 
138
- | Version | Date | Notes |
139
- |---------|------|-------|
140
- | 0.1 | Feb 2026 | Experimental release, 36%→64% overall accuracy, parameter validation regression |
 
 
1
  ---
2
  base_model: Qwen/Qwen3-4B-Instruct-2507
3
  library_name: peft
4
+ license: mit
5
+ language:
6
+ - en
7
  tags:
 
 
8
  - trading
9
  - hyperliquid
10
+ - perpetuals
11
+ - defi
12
+ - lora
13
+ - qlora
14
+ datasets:
15
+ - custom
16
+ pipeline_tag: text-generation
17
  ---
18
 
19
+ # HyperLLM-4b v0.2
 
 
20
 
21
+ A specialized trading assistant fine-tuned for [Hyperliquid](https://hyperliquid.xyz), a perpetual futures DEX. Built on Qwen3-4B-Instruct using QLoRA.
22
 
23
  ## Model Description
24
 
25
+ HyperLLM is designed to assist with Hyperliquid perpetual trading tasks including:
26
+ - Position sizing calculations with proper risk management
27
+ - Hyperliquid API request/response formatting
28
+ - Parameter validation for trades
29
+ - Hyperliquid-specific knowledge (order types, leverage limits, API endpoints)
30
+
31
+ **This is a LoRA adapter** - you need to load it on top of the base model.
32
+
33
+ ## What's New in v0.2 (vs v0.1)
34
+
35
+ | Change | v0.1 | v0.2 |
36
+ |--------|------|------|
37
+ | **Hardware** | Local consumer GPU | A100 80GB (RunPod) |
38
+ | **Max Sequence Length** | 2048 | 4096 |
39
+ | **Batch Size** | 1 | 4 |
40
+ | **rsLoRA** | No | Yes |
41
+ | **Flash Attention** | No | Yes |
42
+ | **Early Stopping** | No | Yes (patience=3) |
43
+ | **Training Precision** | fp16 | bf16 |
44
+ | **Evaluation** | Basic | Comprehensive (297 questions) |
45
+
46
+ ### Key Improvements
47
+ - **+46.7% factual knowledge**: Hyperliquid-specific facts improved from 33.3% → 80.0%
48
+ - **+6.7% API structure**: Better at formatting Hyperliquid API requests
49
+ - **+3.3% position sizing**: Core trading calculation improvements
50
+ - **Longer context**: 4096 tokens vs 2048 for complex multi-step reasoning
51
+ - **rsLoRA**: Rank-stabilized LoRA for better training stability
52
+
53
+ ### Known Regressions
54
+ v0.2 exhibits some catastrophic forgetting compared to the base model:
55
+ - Parameter validation: -20% (73.3% vs 93.3% baseline)
56
+ - Edge case handling: -17.5% (75.0% vs 92.5% baseline)
57
+ - Adversarial percentage questions: -12.5% (36.9% vs 49.4% baseline)
58
+
59
+ These will be addressed in v0.3 with replay data and DPO training.
60
 
61
  ## Training Details
62
 
63
+ | Parameter | Value |
64
+ |-----------|-------|
65
+ | Base Model | Qwen/Qwen3-4B-Instruct-2507 |
66
+ | LoRA Rank | 64 |
67
+ | LoRA Alpha | 128 |
68
+ | Dropout | 0.05 |
69
+ | Learning Rate | 3e-5 |
70
+ | Effective Batch Size | 8 |
71
+ | Training Loss | 0.159 |
72
+ | Token Accuracy | 95.5% |
73
+ | Training Time | 26 minutes |
74
+ | Hardware | NVIDIA A100 80GB |
75
+ | Quantization | 4-bit NF4 (QLoRA) |
76
+
77
+ ### Target Modules
78
+ - q_proj, k_proj, v_proj, o_proj (attention)
79
+ - gate_proj, up_proj, down_proj (MLP)
80
+
81
+ ## Evaluation Results
82
+
83
+ Tested on 297 questions across 9 categories:
84
+
85
+ | Category | Score | vs Baseline |
86
+ |----------|-------|-------------|
87
+ | Factual Knowledge | 80.0% | **+46.7%** |
88
+ | API Structure | 42.5% | +6.7% |
89
+ | Position Sizing | 83.3% | +3.3% |
90
+ | Trading Mechanics | 70.0% | -10.0% |
91
+ | Parameter Validation | 73.3% | -20.0% |
92
+ | Edge Cases | 75.0% | -17.5% |
93
+ | General Capability | 83.6% | -7.3% |
94
+ | Adversarial % | 36.9% | -12.5% |
95
+ | Multi-step Reasoning | 24.0% | -3.0% |
96
+ | **Overall** | **65.0%** | -5.2% |
97
+
98
+ ## Usage
99
+
100
+ ### With Transformers + PEFT
101
 
102
  ```python
103
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
104
  from peft import PeftModel
105
+ import torch
106
+
107
+ # Load base model with 4-bit quantization
108
+ bnb_config = BitsAndBytesConfig(
109
+ load_in_4bit=True,
110
+ bnb_4bit_quant_type="nf4",
111
+ bnb_4bit_compute_dtype=torch.bfloat16,
112
+ )
113
 
 
114
  base_model = AutoModelForCausalLM.from_pretrained(
115
  "Qwen/Qwen3-4B-Instruct-2507",
116
+ quantization_config=bnb_config,
117
  device_map="auto",
 
 
 
 
 
118
  )
119
 
120
  # Load LoRA adapter
121
+ model = PeftModel.from_pretrained(
122
+ base_model,
123
+ "UVLabs/HyperLLM-4b",
124
+ revision="v0.2"
125
+ )
126
+
127
+ tokenizer = AutoTokenizer.from_pretrained("UVLabs/HyperLLM-4b", revision="v0.2")
128
 
129
+ # Example: Position sizing
130
  messages = [
131
+ {"role": "user", "content": "I have $10,000 and want to risk 2% on a BTC long at $50,000 with a stop at $48,000. What position size?"}
 
132
  ]
133
 
134
  text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
135
  inputs = tokenizer(text, return_tensors="pt").to(model.device)
136
+
137
+ outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)
138
  print(tokenizer.decode(outputs[0], skip_special_tokens=True))
139
  ```
140
 
141
+ ### Without Quantization (More VRAM)
142
+
143
+ ```python
144
+ from transformers import AutoModelForCausalLM
145
+ from peft import PeftModel
146
 
147
+ base_model = AutoModelForCausalLM.from_pretrained(
148
+ "Qwen/Qwen3-4B-Instruct-2507",
149
+ torch_dtype=torch.bfloat16,
150
+ device_map="auto",
151
+ )
152
+
153
+ model = PeftModel.from_pretrained(base_model, "UVLabs/HyperLLM-4b", revision="v0.2")
154
+ ```
155
 
156
+ ## Intended Use
157
 
158
+ - Assisting with Hyperliquid perpetual trading calculations
159
+ - Learning Hyperliquid API structure and parameters
160
+ - Position sizing with risk management
161
+ - Understanding Hyperliquid-specific concepts
162
 
163
+ ## Limitations
164
 
165
+ - **Not financial advice**: This model is for educational/informational purposes only
166
+ - **Verify calculations**: Always double-check position sizes and risk calculations
167
+ - **Catastrophic forgetting**: Some general capabilities regressed vs base model
168
+ - **Adversarial inputs**: Model can be confused by tricky percentage questions
169
 
170
+ ## License
171
 
172
+ MIT
173
 
174
  ## Citation
175
 
176
  ```bibtex
177
  @misc{hyperllm2026,
178
+ title={HyperLLM: A Specialized Trading Assistant for Hyperliquid},
179
+ author={UVLabs},
180
  year={2026},
181
+ publisher={Hugging Face},
182
+ url={https://huggingface.co/UVLabs/HyperLLM-4b}
183
  }
184
  ```
185
 
186
+ ## Framework Versions
187
 
188
+ - PEFT: 0.15.0
189
+ - Transformers: 4.52.0
190
+ - PyTorch: 2.7.0
191
+ - bitsandbytes: 0.45.4
adapter_config.json CHANGED
@@ -1,46 +1,39 @@
1
- {
2
- "alora_invocation_tokens": null,
3
- "alpha_pattern": {},
4
- "arrow_config": null,
5
- "auto_mapping": null,
6
- "base_model_name_or_path": "Qwen/Qwen3-4B-Instruct-2507",
7
- "bias": "none",
8
- "corda_config": null,
9
- "ensure_weight_tying": false,
10
- "eva_config": null,
11
- "exclude_modules": null,
12
- "fan_in_fan_out": false,
13
- "inference_mode": true,
14
- "init_lora_weights": true,
15
- "layer_replication": null,
16
- "layers_pattern": null,
17
- "layers_to_transform": null,
18
- "loftq_config": {},
19
- "lora_alpha": 64,
20
- "lora_bias": false,
21
- "lora_dropout": 0.05,
22
- "megatron_config": null,
23
- "megatron_core": "megatron.core",
24
- "modules_to_save": null,
25
- "peft_type": "LORA",
26
- "peft_version": "0.18.1",
27
- "qalora_group_size": 16,
28
- "r": 32,
29
- "rank_pattern": {},
30
- "revision": null,
31
- "target_modules": [
32
- "q_proj",
33
- "down_proj",
34
- "v_proj",
35
- "gate_proj",
36
- "up_proj",
37
- "o_proj",
38
- "k_proj"
39
- ],
40
- "target_parameters": null,
41
- "task_type": "CAUSAL_LM",
42
- "trainable_token_indices": null,
43
- "use_dora": false,
44
- "use_qalora": false,
45
- "use_rslora": false
46
  }
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "Qwen/Qwen3-4B-Instruct-2507",
5
+ "bias": "none",
6
+ "corda_config": null,
7
+ "eva_config": null,
8
+ "exclude_modules": null,
9
+ "fan_in_fan_out": false,
10
+ "inference_mode": true,
11
+ "init_lora_weights": true,
12
+ "layer_replication": null,
13
+ "layers_pattern": null,
14
+ "layers_to_transform": null,
15
+ "loftq_config": {},
16
+ "lora_alpha": 128,
17
+ "lora_bias": false,
18
+ "lora_dropout": 0.05,
19
+ "megatron_config": null,
20
+ "megatron_core": "megatron.core",
21
+ "modules_to_save": null,
22
+ "peft_type": "LORA",
23
+ "r": 64,
24
+ "rank_pattern": {},
25
+ "revision": null,
26
+ "target_modules": [
27
+ "up_proj",
28
+ "v_proj",
29
+ "k_proj",
30
+ "gate_proj",
31
+ "q_proj",
32
+ "down_proj",
33
+ "o_proj"
34
+ ],
35
+ "task_type": "CAUSAL_LM",
36
+ "trainable_token_indices": null,
37
+ "use_dora": false,
38
+ "use_rslora": true
 
 
 
 
 
 
 
39
  }
adapter_model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fc10d854fabecd20bd82bc7314e73317dbd4dab1ac04996b51967232bea39c3e
3
- size 132188392
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e09b554fe2bded98e640b169e10f78a2bcb75946bdd6631f3786dde799ffb390
3
+ size 528550256
added_tokens.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</think>": 151668,
3
+ "</tool_call>": 151658,
4
+ "</tool_response>": 151666,
5
+ "<think>": 151667,
6
+ "<tool_call>": 151657,
7
+ "<tool_response>": 151665,
8
+ "<|box_end|>": 151649,
9
+ "<|box_start|>": 151648,
10
+ "<|endoftext|>": 151643,
11
+ "<|file_sep|>": 151664,
12
+ "<|fim_middle|>": 151660,
13
+ "<|fim_pad|>": 151662,
14
+ "<|fim_prefix|>": 151659,
15
+ "<|fim_suffix|>": 151661,
16
+ "<|im_end|>": 151645,
17
+ "<|im_start|>": 151644,
18
+ "<|image_pad|>": 151655,
19
+ "<|object_ref_end|>": 151647,
20
+ "<|object_ref_start|>": 151646,
21
+ "<|quad_end|>": 151651,
22
+ "<|quad_start|>": 151650,
23
+ "<|repo_name|>": 151663,
24
+ "<|video_pad|>": 151656,
25
+ "<|vision_end|>": 151653,
26
+ "<|vision_pad|>": 151654,
27
+ "<|vision_start|>": 151652
28
+ }
chat_template.jinja CHANGED
@@ -1,61 +1,61 @@
1
- {%- if tools %}
2
- {{- '<|im_start|>system\n' }}
3
- {%- if messages[0].role == 'system' %}
4
- {{- messages[0].content + '\n\n' }}
5
- {%- endif %}
6
- {{- "# 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>" }}
7
- {%- for tool in tools %}
8
- {{- "\n" }}
9
- {{- tool | tojson }}
10
- {%- endfor %}
11
- {{- "\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" }}
12
- {%- else %}
13
- {%- if messages[0].role == 'system' %}
14
- {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
- {%- endif %}
16
- {%- endif %}
17
- {%- for message in messages %}
18
- {%- if message.content is string %}
19
- {%- set content = message.content %}
20
- {%- else %}
21
- {%- set content = '' %}
22
- {%- endif %}
23
- {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
24
- {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
25
- {%- elif message.role == "assistant" %}
26
- {{- '<|im_start|>' + message.role + '\n' + content }}
27
- {%- if message.tool_calls %}
28
- {%- for tool_call in message.tool_calls %}
29
- {%- if (loop.first and content) or (not loop.first) %}
30
- {{- '\n' }}
31
- {%- endif %}
32
- {%- if tool_call.function %}
33
- {%- set tool_call = tool_call.function %}
34
- {%- endif %}
35
- {{- '<tool_call>\n{"name": "' }}
36
- {{- tool_call.name }}
37
- {{- '", "arguments": ' }}
38
- {%- if tool_call.arguments is string %}
39
- {{- tool_call.arguments }}
40
- {%- else %}
41
- {{- tool_call.arguments | tojson }}
42
- {%- endif %}
43
- {{- '}\n</tool_call>' }}
44
- {%- endfor %}
45
- {%- endif %}
46
- {{- '<|im_end|>\n' }}
47
- {%- elif message.role == "tool" %}
48
- {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
49
- {{- '<|im_start|>user' }}
50
- {%- endif %}
51
- {{- '\n<tool_response>\n' }}
52
- {{- content }}
53
- {{- '\n</tool_response>' }}
54
- {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
55
- {{- '<|im_end|>\n' }}
56
- {%- endif %}
57
- {%- endif %}
58
- {%- endfor %}
59
- {%- if add_generation_prompt %}
60
- {{- '<|im_start|>assistant\n' }}
61
  {%- endif %}
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# 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>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\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" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- for message in messages %}
18
+ {%- if message.content is string %}
19
+ {%- set content = message.content %}
20
+ {%- else %}
21
+ {%- set content = '' %}
22
+ {%- endif %}
23
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
24
+ {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
25
+ {%- elif message.role == "assistant" %}
26
+ {{- '<|im_start|>' + message.role + '\n' + content }}
27
+ {%- if message.tool_calls %}
28
+ {%- for tool_call in message.tool_calls %}
29
+ {%- if (loop.first and content) or (not loop.first) %}
30
+ {{- '\n' }}
31
+ {%- endif %}
32
+ {%- if tool_call.function %}
33
+ {%- set tool_call = tool_call.function %}
34
+ {%- endif %}
35
+ {{- '<tool_call>\n{"name": "' }}
36
+ {{- tool_call.name }}
37
+ {{- '", "arguments": ' }}
38
+ {%- if tool_call.arguments is string %}
39
+ {{- tool_call.arguments }}
40
+ {%- else %}
41
+ {{- tool_call.arguments | tojson }}
42
+ {%- endif %}
43
+ {{- '}\n</tool_call>' }}
44
+ {%- endfor %}
45
+ {%- endif %}
46
+ {{- '<|im_end|>\n' }}
47
+ {%- elif message.role == "tool" %}
48
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
49
+ {{- '<|im_start|>user' }}
50
+ {%- endif %}
51
+ {{- '\n<tool_response>\n' }}
52
+ {{- content }}
53
+ {{- '\n</tool_response>' }}
54
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
55
+ {{- '<|im_end|>\n' }}
56
+ {%- endif %}
57
+ {%- endif %}
58
+ {%- endfor %}
59
+ {%- if add_generation_prompt %}
60
+ {{- '<|im_start|>assistant\n' }}
61
  {%- endif %}
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
special_tokens_map.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|object_ref_start|>",
6
+ "<|object_ref_end|>",
7
+ "<|box_start|>",
8
+ "<|box_end|>",
9
+ "<|quad_start|>",
10
+ "<|quad_end|>",
11
+ "<|vision_start|>",
12
+ "<|vision_end|>",
13
+ "<|vision_pad|>",
14
+ "<|image_pad|>",
15
+ "<|video_pad|>"
16
+ ],
17
+ "eos_token": {
18
+ "content": "<|im_end|>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ },
24
+ "pad_token": {
25
+ "content": "<|endoftext|>",
26
+ "lstrip": false,
27
+ "normalized": false,
28
+ "rstrip": false,
29
+ "single_word": false
30
+ }
31
+ }
tokenizer.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
3
- size 11422650
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4
3
+ size 11422654
tokenizer_config.json CHANGED
@@ -1,29 +1,239 @@
1
- {
2
- "add_prefix_space": false,
3
- "backend": "tokenizers",
4
- "bos_token": null,
5
- "clean_up_tokenization_spaces": false,
6
- "eos_token": "<|im_end|>",
7
- "errors": "replace",
8
- "extra_special_tokens": [
9
- "<|im_start|>",
10
- "<|im_end|>",
11
- "<|object_ref_start|>",
12
- "<|object_ref_end|>",
13
- "<|box_start|>",
14
- "<|box_end|>",
15
- "<|quad_start|>",
16
- "<|quad_end|>",
17
- "<|vision_start|>",
18
- "<|vision_end|>",
19
- "<|vision_pad|>",
20
- "<|image_pad|>",
21
- "<|video_pad|>"
22
- ],
23
- "is_local": false,
24
- "model_max_length": 1010000,
25
- "pad_token": "<|endoftext|>",
26
- "split_special_tokens": false,
27
- "tokenizer_class": "Qwen2Tokenizer",
28
- "unk_token": null
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ }
213
+ },
214
+ "additional_special_tokens": [
215
+ "<|im_start|>",
216
+ "<|im_end|>",
217
+ "<|object_ref_start|>",
218
+ "<|object_ref_end|>",
219
+ "<|box_start|>",
220
+ "<|box_end|>",
221
+ "<|quad_start|>",
222
+ "<|quad_end|>",
223
+ "<|vision_start|>",
224
+ "<|vision_end|>",
225
+ "<|vision_pad|>",
226
+ "<|image_pad|>",
227
+ "<|video_pad|>"
228
+ ],
229
+ "bos_token": null,
230
+ "clean_up_tokenization_spaces": false,
231
+ "eos_token": "<|im_end|>",
232
+ "errors": "replace",
233
+ "extra_special_tokens": {},
234
+ "model_max_length": 1010000,
235
+ "pad_token": "<|endoftext|>",
236
+ "split_special_tokens": false,
237
+ "tokenizer_class": "Qwen2Tokenizer",
238
+ "unk_token": null
239
+ }
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9fc482d1a7a435ff60ed479644c45fe7c1409ffca63ecaa9803840a33769fd74
3
- size 5240
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7cf6dcfb7fa01a043537d453752ebabff6db298fb689b4df160bb4e3b59dd414
3
+ size 5688
vocab.json ADDED
The diff for this file is too large to render. See raw diff