initial, eval_loss: 0.5200754404067993
Browse files- .gitattributes +1 -0
- README.md +109 -3
- adapter_config.json +37 -0
- adapter_model.bin +3 -0
- added_tokens.json +24 -0
- chat_transformers.py +154 -0
- generation_config.json +14 -0
- merges.txt +0 -0
- optimizer.pt +3 -0
- requirements.txt +6 -0
- rng_state.pth +3 -0
- scheduler.pt +3 -0
- special_tokens_map.json +31 -0
- tokenizer.json +3 -0
- tokenizer_config.json +208 -0
- trainer_state.json +0 -0
- training_args.bin +3 -0
- vocab.json +0 -0
.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
CHANGED
|
@@ -1,3 +1,109 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- Egor-AI/Russian_thinking_dataset
|
| 5 |
+
language:
|
| 6 |
+
- ru
|
| 7 |
+
- en
|
| 8 |
+
base_model:
|
| 9 |
+
- t-tech/T-lite-it-1.0
|
| 10 |
+
pipeline_tag: question-answering
|
| 11 |
+
library_name: peft
|
| 12 |
+
tags:
|
| 13 |
+
- chat
|
| 14 |
+
- o1
|
| 15 |
+
- cot
|
| 16 |
+
- thinking
|
| 17 |
+
- reflection
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Russian o1 / T-lite-it-1.0 LoRA
|
| 21 |
+
|
| 22 |
+
Based on https://huggingface.co/evilfreelancer/o1_t-lite-it-1.0_lora
|
| 23 |
+
|
| 24 |
+
LoRA-адаптер для модели [T-lite-it-1.0](https://huggingface.co/t-tech/T-lite-it-1.0) обученный на
|
| 25 |
+
датасете [Egor-AI/Russian_thinking_dataset](https://huggingface.co/datasets/Egor-AI/Russian_thinking_dataset) (машинный
|
| 26 |
+
перевод на русский язык
|
| 27 |
+
датасета [BintangFortuna/OpenO1-SFT-EN-SY](https://huggingface.co/datasets/BintangFortuna/OpenO1-SFT-EN-SY)).
|
| 28 |
+
|
| 29 |
+
Обученная модель способна имитировать логические размышлению на русском языке по аналогии с тем, как
|
| 30 |
+
это делает `o1` от `OpenAI`.
|
| 31 |
+
|
| 32 |
+
Необходимо использовать следующего вида системный промт:
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
Вы — ИИ-помощник. Отформатируйте свои ответы следующим образом: <Thought> Ваши мысли (понимание, рассуждения) </Thought> <output> Ваш ответ </output>
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
Обучение производилось при помощи утилиты [impruver](https://github.com/EvilFreelancer/impruver) используя конфигурацию
|
| 39 |
+
[T-lite-it/7B_lora_thinking](https://github.com/EvilFreelancer/impruver/blob/main/recipes/configs/T-lite-it/7B_lora_thinking.yaml) с донастройкой:
|
| 40 |
+
- load_in_4bit: false
|
| 41 |
+
- без max_tokens_count
|
| 42 |
+
- optim: adamw_8bit
|
| 43 |
+
- gradient_accumulation_steps: 1
|
| 44 |
+
|
| 45 |
+
На всё про всё ушло примерно 17.6 часов на 1xH100 80GB, при этом понадобилось 67Гб видеопамяти.
|
| 46 |
+
|
| 47 |
+
Результатирующий eval_loss: 0.5200754404067993
|
| 48 |
+
|
| 49 |
+
W&B run: https://wandb.ai/b37h3z3n/trains/runs/6vwvuu46?nw=nwuserb37h3z3n
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
```yaml
|
| 53 |
+
output_dir: ./models/T-lite-it_7B_lora_thinking
|
| 54 |
+
train_path: ./train.T-lite-it_7B_lora_thinking.jsonl
|
| 55 |
+
val_path: ./val.T-lite-it_7B_lora_thinking.jsonl
|
| 56 |
+
|
| 57 |
+
datasets:
|
| 58 |
+
- name: Egor-AI/Russian_thinking_dataset
|
| 59 |
+
converter: impruver.instruction_to_messages
|
| 60 |
+
add_global_bos: false
|
| 61 |
+
add_global_eos: false
|
| 62 |
+
mapping:
|
| 63 |
+
system: system
|
| 64 |
+
instruction: prompt
|
| 65 |
+
output: response
|
| 66 |
+
|
| 67 |
+
model:
|
| 68 |
+
class: transformers.AutoModelForCausalLM
|
| 69 |
+
name: t-tech/T-lite-it-1.0
|
| 70 |
+
load_in_4bit: false
|
| 71 |
+
load_in_8bit: false
|
| 72 |
+
dtype: bf16
|
| 73 |
+
|
| 74 |
+
lora:
|
| 75 |
+
r: 16
|
| 76 |
+
lora_alpha: 16
|
| 77 |
+
lora_dropout: 0
|
| 78 |
+
bias: none
|
| 79 |
+
target_modules: [ q_proj, k_proj, v_proj, o_proj, gate_proj, down_proj, up_proj ]
|
| 80 |
+
task_type: CAUSAL_LM
|
| 81 |
+
|
| 82 |
+
tokenizer:
|
| 83 |
+
class: transformers.AutoTokenizer
|
| 84 |
+
name: t-tech/T-lite-it-1.0
|
| 85 |
+
# max_tokens_count: 1500
|
| 86 |
+
|
| 87 |
+
trainer:
|
| 88 |
+
eval_strategy: steps
|
| 89 |
+
save_strategy: steps
|
| 90 |
+
eval_steps: 100
|
| 91 |
+
save_steps: 100
|
| 92 |
+
per_device_train_batch_size: 1
|
| 93 |
+
per_device_eval_batch_size: 1
|
| 94 |
+
gradient_accumulation_steps: 1
|
| 95 |
+
logging_steps: 10
|
| 96 |
+
learning_rate: 0.0004
|
| 97 |
+
num_train_epochs: 3
|
| 98 |
+
lr_scheduler_type: cosine
|
| 99 |
+
warmup_steps: 16
|
| 100 |
+
optim: adamw_torch_4bit
|
| 101 |
+
metric_for_best_model: eval_loss
|
| 102 |
+
load_best_model_at_end: true
|
| 103 |
+
save_total_limit: 2
|
| 104 |
+
seed: 42
|
| 105 |
+
remove_unused_columns: false
|
| 106 |
+
max_grad_norm: 1.0
|
| 107 |
+
weight_decay: 0.08
|
| 108 |
+
torch_compile: false
|
| 109 |
+
```
|
adapter_config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "/root/T-lite-it-1.0",
|
| 5 |
+
"bias": "none",
|
| 6 |
+
"eva_config": null,
|
| 7 |
+
"exclude_modules": null,
|
| 8 |
+
"fan_in_fan_out": false,
|
| 9 |
+
"inference_mode": true,
|
| 10 |
+
"init_lora_weights": true,
|
| 11 |
+
"layer_replication": null,
|
| 12 |
+
"layers_pattern": null,
|
| 13 |
+
"layers_to_transform": null,
|
| 14 |
+
"loftq_config": {},
|
| 15 |
+
"lora_alpha": 16,
|
| 16 |
+
"lora_bias": false,
|
| 17 |
+
"lora_dropout": 0,
|
| 18 |
+
"megatron_config": null,
|
| 19 |
+
"megatron_core": "megatron.core",
|
| 20 |
+
"modules_to_save": null,
|
| 21 |
+
"peft_type": "LORA",
|
| 22 |
+
"r": 16,
|
| 23 |
+
"rank_pattern": {},
|
| 24 |
+
"revision": null,
|
| 25 |
+
"target_modules": [
|
| 26 |
+
"o_proj",
|
| 27 |
+
"q_proj",
|
| 28 |
+
"down_proj",
|
| 29 |
+
"up_proj",
|
| 30 |
+
"gate_proj",
|
| 31 |
+
"k_proj",
|
| 32 |
+
"v_proj"
|
| 33 |
+
],
|
| 34 |
+
"task_type": "CAUSAL_LM",
|
| 35 |
+
"use_dora": false,
|
| 36 |
+
"use_rslora": false
|
| 37 |
+
}
|
adapter_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91bcf35e7cad58f9547bc8ef30d89b622d3881f4cb4d47632298cac0df248ffc
|
| 3 |
+
size 161621802
|
added_tokens.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"</tool_call>": 151658,
|
| 3 |
+
"<tool_call>": 151657,
|
| 4 |
+
"<|box_end|>": 151649,
|
| 5 |
+
"<|box_start|>": 151648,
|
| 6 |
+
"<|endoftext|>": 151643,
|
| 7 |
+
"<|file_sep|>": 151664,
|
| 8 |
+
"<|fim_middle|>": 151660,
|
| 9 |
+
"<|fim_pad|>": 151662,
|
| 10 |
+
"<|fim_prefix|>": 151659,
|
| 11 |
+
"<|fim_suffix|>": 151661,
|
| 12 |
+
"<|im_end|>": 151645,
|
| 13 |
+
"<|im_start|>": 151644,
|
| 14 |
+
"<|image_pad|>": 151655,
|
| 15 |
+
"<|object_ref_end|>": 151647,
|
| 16 |
+
"<|object_ref_start|>": 151646,
|
| 17 |
+
"<|quad_end|>": 151651,
|
| 18 |
+
"<|quad_start|>": 151650,
|
| 19 |
+
"<|repo_name|>": 151663,
|
| 20 |
+
"<|video_pad|>": 151656,
|
| 21 |
+
"<|vision_end|>": 151653,
|
| 22 |
+
"<|vision_pad|>": 151654,
|
| 23 |
+
"<|vision_start|>": 151652
|
| 24 |
+
}
|
chat_transformers.py
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import fire
|
| 2 |
+
from typing import List, Dict
|
| 3 |
+
import torch
|
| 4 |
+
from peft import PeftModel
|
| 5 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig, BitsAndBytesConfig
|
| 6 |
+
|
| 7 |
+
MODEL_BASE = "t-tech/T-lite-it-1.0"
|
| 8 |
+
MODEL_ADAPTER = "evilfreelancer/o1_t-lite-it-1.0_lora"
|
| 9 |
+
|
| 10 |
+
SYSTEM_PROMPT = "Вы — ИИ-помощник. Отформатируйте свои ответы следующим образом: <Thought> Ваши мысли (понимание, рассуждения) </Thought> <output> Ваш ответ </output>"
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ChatHistory:
|
| 14 |
+
def __init__(self, history_limit: int = None, system_prompt: str = None):
|
| 15 |
+
self.history_limit: int | None = history_limit
|
| 16 |
+
self.system_prompt: str | None = system_prompt
|
| 17 |
+
self.messages: List[Dict] = []
|
| 18 |
+
if self.system_prompt is not None:
|
| 19 |
+
self.messages.append({"role": "system", "content": self.system_prompt})
|
| 20 |
+
|
| 21 |
+
def add_message(self, role: str, message: str):
|
| 22 |
+
self.messages.append({"role": role, "content": message})
|
| 23 |
+
self.trim_history()
|
| 24 |
+
|
| 25 |
+
def add_user_message(self, message: str):
|
| 26 |
+
self.add_message("user", message)
|
| 27 |
+
|
| 28 |
+
def add_assistant_message(self, message: str):
|
| 29 |
+
self.add_message("assistant", message)
|
| 30 |
+
|
| 31 |
+
def add_function_call(self, message: str):
|
| 32 |
+
self.add_message("function_call", message)
|
| 33 |
+
|
| 34 |
+
def add_function_response(self, message: str):
|
| 35 |
+
self.add_message("function_response", message)
|
| 36 |
+
|
| 37 |
+
def trim_history(self):
|
| 38 |
+
appendix = 0
|
| 39 |
+
if self.system_prompt is not None:
|
| 40 |
+
appendix = 1
|
| 41 |
+
if self.history_limit is not None and len(self.messages) > self.history_limit + appendix:
|
| 42 |
+
overflow = len(self.messages) - (self.history_limit + appendix)
|
| 43 |
+
self.messages = [self.messages[0]] + self.messages[overflow + appendix:]
|
| 44 |
+
|
| 45 |
+
def get_messages(self) -> list:
|
| 46 |
+
return self.messages
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def generate(model, tokenizer, prompt, generation_config):
|
| 50 |
+
data = tokenizer(prompt, return_tensors="pt")
|
| 51 |
+
data = {k: v.to(model.device) for k, v in data.items()}
|
| 52 |
+
output_ids = model.generate(**data, generation_config=generation_config)[0]
|
| 53 |
+
output_ids = output_ids[len(data["input_ids"][0]):]
|
| 54 |
+
output = tokenizer.decode(output_ids, skip_special_tokens=True)
|
| 55 |
+
return output.strip()
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
def get_prompt(tokenizer, messages: List[Dict], add_generation_prompt: bool = False):
|
| 59 |
+
return tokenizer.apply_chat_template(
|
| 60 |
+
messages,
|
| 61 |
+
add_special_tokens=False,
|
| 62 |
+
tokenize=False,
|
| 63 |
+
add_generation_prompt=add_generation_prompt,
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def chat(
|
| 68 |
+
history_limit: int = 1,
|
| 69 |
+
system_prompt: str | None = SYSTEM_PROMPT,
|
| 70 |
+
max_new_tokens: int = 2048,
|
| 71 |
+
repetition_penalty: float = 1.2,
|
| 72 |
+
do_sample: bool = True,
|
| 73 |
+
temperature: float = 0.5,
|
| 74 |
+
top_p: float = 0.6,
|
| 75 |
+
top_k: int = 40,
|
| 76 |
+
):
|
| 77 |
+
#
|
| 78 |
+
# Tokenizer preparation
|
| 79 |
+
#
|
| 80 |
+
|
| 81 |
+
tokenizer = AutoTokenizer.from_pretrained(MODEL_BASE)
|
| 82 |
+
|
| 83 |
+
#
|
| 84 |
+
# Model preparation
|
| 85 |
+
#
|
| 86 |
+
|
| 87 |
+
# Quantization config
|
| 88 |
+
quantization_config = BitsAndBytesConfig(
|
| 89 |
+
load_in_4bit=True,
|
| 90 |
+
bnb_4bit_compute_dtype=torch.bfloat16,
|
| 91 |
+
bnb_4bit_quant_type="nf4",
|
| 92 |
+
bnb_4bit_use_double_quant=True
|
| 93 |
+
)
|
| 94 |
+
|
| 95 |
+
# Generator config
|
| 96 |
+
generation_config = GenerationConfig.from_pretrained(MODEL_ADAPTER)
|
| 97 |
+
generation_config.max_new_tokens = max_new_tokens
|
| 98 |
+
generation_config.repetition_penalty = repetition_penalty
|
| 99 |
+
generation_config.do_sample = do_sample
|
| 100 |
+
generation_config.temperature = temperature
|
| 101 |
+
generation_config.top_p = top_p
|
| 102 |
+
generation_config.top_k = top_k
|
| 103 |
+
|
| 104 |
+
# Read model from folder with trained checkpoints
|
| 105 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 106 |
+
MODEL_BASE,
|
| 107 |
+
generation_config=generation_config,
|
| 108 |
+
quantization_config=quantization_config,
|
| 109 |
+
torch_dtype=torch.bfloat16,
|
| 110 |
+
attn_implementation=None
|
| 111 |
+
)
|
| 112 |
+
|
| 113 |
+
# If we've trained a LoRA adapter
|
| 114 |
+
model = PeftModel.from_pretrained(
|
| 115 |
+
model=model,
|
| 116 |
+
model_id=MODEL_ADAPTER,
|
| 117 |
+
torch_dtype=torch.bfloat16,
|
| 118 |
+
)
|
| 119 |
+
|
| 120 |
+
#
|
| 121 |
+
# Chat loop
|
| 122 |
+
#
|
| 123 |
+
|
| 124 |
+
# Start chat loop
|
| 125 |
+
chat_history = ChatHistory(history_limit, system_prompt)
|
| 126 |
+
while True:
|
| 127 |
+
user_message = input("User: ")
|
| 128 |
+
|
| 129 |
+
# Reset chat command
|
| 130 |
+
if user_message.strip() == "/reset":
|
| 131 |
+
chat_history = ChatHistory(history_limit, system_prompt)
|
| 132 |
+
print("History reset completed!")
|
| 133 |
+
continue
|
| 134 |
+
|
| 135 |
+
# Skip empty messages from user
|
| 136 |
+
if user_message.strip() == "":
|
| 137 |
+
continue
|
| 138 |
+
|
| 139 |
+
# Add user message to chat history
|
| 140 |
+
chat_history.add_user_message(user_message)
|
| 141 |
+
|
| 142 |
+
# Get list of messages
|
| 143 |
+
prompt = get_prompt(tokenizer, chat_history.get_messages(), True)
|
| 144 |
+
|
| 145 |
+
# Generate response
|
| 146 |
+
output = generate(model, tokenizer, prompt, generation_config)
|
| 147 |
+
|
| 148 |
+
# Save response to chat history as assistant's message
|
| 149 |
+
chat_history.add_assistant_message(output)
|
| 150 |
+
print("Assistant:", output)
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
if __name__ == "__main__":
|
| 154 |
+
fire.Fire(chat)
|
generation_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_sample": true,
|
| 3 |
+
"temperature": 0.7,
|
| 4 |
+
"top_k": 70,
|
| 5 |
+
"top_p": 0.8,
|
| 6 |
+
"repetition_penalty": 1.05,
|
| 7 |
+
"pad_token_id": 151643,
|
| 8 |
+
"bos_token_id": 151643,
|
| 9 |
+
"eos_token_id": [
|
| 10 |
+
151645,
|
| 11 |
+
151643
|
| 12 |
+
],
|
| 13 |
+
"transformers_version": "4.47.1"
|
| 14 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
optimizer.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb9505628340c6e36bef0c05abac1bea0c27c34f5d7c539cc6fc4c621397a752
|
| 3 |
+
size 82461812
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pyyaml>=6.0.2
|
| 2 |
+
fire>=0.7.0
|
| 3 |
+
torch>=2.5.1
|
| 4 |
+
transformers>=4.47.1
|
| 5 |
+
peft>=0.14.0
|
| 6 |
+
bitsandbytes>=0.45.0
|
rng_state.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8dccfcc3afceab4d2d2b25fbb67392f946fa9f1c9efbf11612cbcfa90ce2d337
|
| 3 |
+
size 14244
|
scheduler.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cd8b83240cd31306fe73d6b8457fc426e2cc12ec08175c34c0dcaf6298b44bb9
|
| 3 |
+
size 1064
|
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
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa
|
| 3 |
+
size 11421896
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
},
|
| 182 |
+
"additional_special_tokens": [
|
| 183 |
+
"<|im_start|>",
|
| 184 |
+
"<|im_end|>",
|
| 185 |
+
"<|object_ref_start|>",
|
| 186 |
+
"<|object_ref_end|>",
|
| 187 |
+
"<|box_start|>",
|
| 188 |
+
"<|box_end|>",
|
| 189 |
+
"<|quad_start|>",
|
| 190 |
+
"<|quad_end|>",
|
| 191 |
+
"<|vision_start|>",
|
| 192 |
+
"<|vision_end|>",
|
| 193 |
+
"<|vision_pad|>",
|
| 194 |
+
"<|image_pad|>",
|
| 195 |
+
"<|video_pad|>"
|
| 196 |
+
],
|
| 197 |
+
"bos_token": null,
|
| 198 |
+
"chat_template": "{% for message in messages %}\n {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' -}}\n{% endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\n' -}}\n{%- endif %}",
|
| 199 |
+
"clean_up_tokenization_spaces": false,
|
| 200 |
+
"eos_token": "<|im_end|>",
|
| 201 |
+
"errors": "replace",
|
| 202 |
+
"extra_special_tokens": {},
|
| 203 |
+
"model_max_length": 8192,
|
| 204 |
+
"pad_token": "<|endoftext|>",
|
| 205 |
+
"split_special_tokens": false,
|
| 206 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 207 |
+
"unk_token": null
|
| 208 |
+
}
|
trainer_state.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6dd51dc0e7660db8c62dacf10a35046078f9de0202bb28175ee7193728a5b59c
|
| 3 |
+
size 5432
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|