Text Generation
PEFT
Russian
English
r1
reasoning
think
thinking
reflection
russian
general
conversational
Instructions to use evilfreelancer/r1_yandexgpt5-lite_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use evilfreelancer/r1_yandexgpt5-lite_lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("yandex/YandexGPT-5-Lite-8B-pretrain") model = PeftModel.from_pretrained(base_model, "evilfreelancer/r1_yandexgpt5-lite_lora") - Notebooks
- Google Colab
- Kaggle
pasha commited on
Commit ·
8009b99
1
Parent(s): f57b007
Readme updated
Browse files- .gitignore +1 -0
- README.md +115 -199
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
/.idea/
|
README.md
CHANGED
|
@@ -1,216 +1,132 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
datasets:
|
| 4 |
-
- mizinovmv/ru_example_DeepSeek-R1-Distill-Qwen-32B
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
language:
|
| 6 |
-
- ru
|
|
|
|
| 7 |
base_model:
|
| 8 |
-
- yandex/YandexGPT-5-Lite-8B-pretrain
|
| 9 |
pipeline_tag: text-generation
|
| 10 |
library_name: peft
|
| 11 |
tags:
|
| 12 |
-
- r1
|
| 13 |
-
- reasoning
|
| 14 |
-
- think
|
| 15 |
-
- thinking
|
| 16 |
-
-
|
| 17 |
-
-
|
|
|
|
| 18 |
---
|
| 19 |
|
| 20 |
-
#
|
| 21 |
|
| 22 |
-
|
|
|
|
| 23 |
|
|
|
|
|
|
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
-
|
|
|
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 120 |
-
|
| 121 |
-
### Testing Data, Factors & Metrics
|
| 122 |
-
|
| 123 |
-
#### Testing Data
|
| 124 |
-
|
| 125 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 126 |
-
|
| 127 |
-
[More Information Needed]
|
| 128 |
-
|
| 129 |
-
#### Factors
|
| 130 |
-
|
| 131 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 132 |
-
|
| 133 |
-
[More Information Needed]
|
| 134 |
-
|
| 135 |
-
#### Metrics
|
| 136 |
-
|
| 137 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
### Results
|
| 142 |
-
|
| 143 |
-
[More Information Needed]
|
| 144 |
-
|
| 145 |
-
#### Summary
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
## Model Examination [optional]
|
| 150 |
-
|
| 151 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 152 |
-
|
| 153 |
-
[More Information Needed]
|
| 154 |
-
|
| 155 |
-
## Environmental Impact
|
| 156 |
-
|
| 157 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 158 |
-
|
| 159 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 160 |
-
|
| 161 |
-
- **Hardware Type:** [More Information Needed]
|
| 162 |
-
- **Hours used:** [More Information Needed]
|
| 163 |
-
- **Cloud Provider:** [More Information Needed]
|
| 164 |
-
- **Compute Region:** [More Information Needed]
|
| 165 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 166 |
-
|
| 167 |
-
## Technical Specifications [optional]
|
| 168 |
-
|
| 169 |
-
### Model Architecture and Objective
|
| 170 |
-
|
| 171 |
-
[More Information Needed]
|
| 172 |
-
|
| 173 |
-
### Compute Infrastructure
|
| 174 |
-
|
| 175 |
-
[More Information Needed]
|
| 176 |
-
|
| 177 |
-
#### Hardware
|
| 178 |
-
|
| 179 |
-
[More Information Needed]
|
| 180 |
-
|
| 181 |
-
#### Software
|
| 182 |
-
|
| 183 |
-
[More Information Needed]
|
| 184 |
-
|
| 185 |
-
## Citation [optional]
|
| 186 |
-
|
| 187 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 188 |
-
|
| 189 |
-
**BibTeX:**
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
**APA:**
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Glossary [optional]
|
| 198 |
-
|
| 199 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 200 |
-
|
| 201 |
-
[More Information Needed]
|
| 202 |
-
|
| 203 |
-
## More Information [optional]
|
| 204 |
-
|
| 205 |
-
[More Information Needed]
|
| 206 |
-
|
| 207 |
-
## Model Card Authors [optional]
|
| 208 |
-
|
| 209 |
-
[More Information Needed]
|
| 210 |
-
|
| 211 |
-
## Model Card Contact
|
| 212 |
-
|
| 213 |
-
[More Information Needed]
|
| 214 |
-
### Framework versions
|
| 215 |
-
|
| 216 |
-
- PEFT 0.14.0
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
datasets:
|
| 4 |
+
- mizinovmv/ru_example_DeepSeek-R1-Distill-Qwen-32B
|
| 5 |
+
- lightblue/reasoning-multilingual-R1-Llama-70B-train
|
| 6 |
+
- Pinkstack/thinking-multilingual-30-23-small-690
|
| 7 |
+
- Vikhrmodels/reasoning-0.01-ru
|
| 8 |
+
- Vikhrmodels/russian_math
|
| 9 |
+
- kristaller486/Nebo-T1-Russian
|
| 10 |
language:
|
| 11 |
+
- ru
|
| 12 |
+
- en
|
| 13 |
base_model:
|
| 14 |
+
- yandex/YandexGPT-5-Lite-8B-pretrain
|
| 15 |
pipeline_tag: text-generation
|
| 16 |
library_name: peft
|
| 17 |
tags:
|
| 18 |
+
- r1
|
| 19 |
+
- reasoning
|
| 20 |
+
- think
|
| 21 |
+
- thinking
|
| 22 |
+
- reflection
|
| 23 |
+
- russian
|
| 24 |
+
- general
|
| 25 |
---
|
| 26 |
|
| 27 |
+
# Russian r1 / YandexGPT-5-Lite-8B-pretrain
|
| 28 |
|
| 29 |
+
LoRA-адаптер для модели [YandexGPT-5-Lite-8B-pretrain](https://huggingface.co/yandex/YandexGPT-5-Lite-8B-pretrain)
|
| 30 |
+
обученный на миксе из датасетов реализующих r1 (ризонинг) подход.
|
| 31 |
|
| 32 |
+
Обученная модель способна имитировать логические размышлению на русском языке по аналогии с тем, как
|
| 33 |
+
это делает `r1` от `DeepSeek` или `o1` от `OpenAI` .
|
| 34 |
|
| 35 |
+
W&B отчёт: https://api.wandb.ai/links/evilfreelancer/zj6s02v4
|
| 36 |
|
| 37 |
+
Обучение производилось при помощи утилиты [impruver](https://github.com/EvilFreelancer/impruver) используя конфигурацию
|
| 38 |
+
[YandexGPT/8B_lora_r1](https://github.com/EvilFreelancer/impruver/blob/main/recipes/configs/YandexGPT/8B_lora_r1.yaml).
|
| 39 |
|
| 40 |
+
На всё про всё ушло примерно 18 часов на RTX 4090, при этом понадобилось 23.5Гб видеопамяти.
|
| 41 |
|
| 42 |
+
```yaml
|
| 43 |
+
output_dir: ./models/YandexGPT-5-Lite_7B_lora_thinking
|
| 44 |
+
train_path: ./train.YandexGPT-5-Lite_7B_lora_thinking.jsonl
|
| 45 |
+
val_path: ./val.YandexGPT-5-Lite_7B_lora_thinking.jsonl
|
| 46 |
|
| 47 |
+
datasets:
|
| 48 |
+
- name: mizinovmv/ru_example_DeepSeek-R1-Distill-Qwen-32B
|
| 49 |
+
converter: impruver.instruction_to_messages
|
| 50 |
+
add_global_bos: false
|
| 51 |
+
add_global_eos: false
|
| 52 |
+
mapping:
|
| 53 |
+
instruction: ru_query
|
| 54 |
+
output: response
|
| 55 |
+
- name: lightblue/reasoning-multilingual-R1-Llama-70B-train
|
| 56 |
+
converter: impruver.instruction_to_messages
|
| 57 |
+
add_global_bos: false
|
| 58 |
+
add_global_eos: false
|
| 59 |
+
mapping:
|
| 60 |
+
instruction: translated_prompt
|
| 61 |
+
output: response
|
| 62 |
+
- name: Pinkstack/thinking-multilingual-30-23-full-690
|
| 63 |
+
converter: impruver.instruction_to_messages
|
| 64 |
+
add_global_bos: false
|
| 65 |
+
add_global_eos: false
|
| 66 |
+
- name: Vikhrmodels/reasoning-0.01-ru
|
| 67 |
+
converter: impruver.reasoning_to_messages
|
| 68 |
+
add_global_bos: false
|
| 69 |
+
add_global_eos: false
|
| 70 |
+
- name: Vikhrmodels/russian_math
|
| 71 |
+
converter: impruver.reasoning_to_messages
|
| 72 |
+
add_global_bos: false
|
| 73 |
+
add_global_eos: false
|
| 74 |
+
mapping:
|
| 75 |
+
instruction: task
|
| 76 |
+
reasoning: solution
|
| 77 |
+
output: short answer
|
| 78 |
+
- name: kristaller486/Nebo-T1-Russian
|
| 79 |
+
converter: impruver.reasoning_to_messages
|
| 80 |
+
add_global_bos: false
|
| 81 |
+
add_global_eos: false
|
| 82 |
+
mapping:
|
| 83 |
+
instruction: prompt
|
| 84 |
+
reasoning: think
|
| 85 |
+
output: answer
|
| 86 |
+
|
| 87 |
+
model:
|
| 88 |
+
class: transformers.AutoModelForCausalLM
|
| 89 |
+
name: yandex/YandexGPT-5-Lite-8B-pretrain
|
| 90 |
+
load_in_4bit: true
|
| 91 |
+
load_in_8bit: false
|
| 92 |
+
dtype: bf16
|
| 93 |
+
|
| 94 |
+
lora:
|
| 95 |
+
r: 8 # higher increases accuracy and memory
|
| 96 |
+
lora_alpha: 16 # usually alpha=2*rank
|
| 97 |
+
lora_dropout: 0
|
| 98 |
+
bias: none
|
| 99 |
+
target_modules: [ 'q_proj', 'v_proj', 'output_proj' ]
|
| 100 |
+
task_type: CAUSAL_LM
|
| 101 |
+
|
| 102 |
+
tokenizer:
|
| 103 |
+
class: transformers.AutoTokenizer
|
| 104 |
+
name: yandex/YandexGPT-5-Lite-8B-pretrain
|
| 105 |
+
max_tokens_count: 1400
|
| 106 |
+
special_tokens:
|
| 107 |
+
pad_token_id: 1
|
| 108 |
+
pad_token: <s>
|
| 109 |
+
|
| 110 |
+
trainer:
|
| 111 |
+
eval_strategy: steps
|
| 112 |
+
save_strategy: steps
|
| 113 |
+
eval_steps: 1000
|
| 114 |
+
save_steps: 1000
|
| 115 |
+
per_device_train_batch_size: 1
|
| 116 |
+
per_device_eval_batch_size: 1
|
| 117 |
+
gradient_accumulation_steps: 8
|
| 118 |
+
logging_steps: 10
|
| 119 |
+
learning_rate: 0.000005
|
| 120 |
+
num_train_epochs: 2
|
| 121 |
+
lr_scheduler_type: cosine
|
| 122 |
+
warmup_steps: 100
|
| 123 |
+
optim: adamw_torch_4bit
|
| 124 |
+
metric_for_best_model: eval_loss
|
| 125 |
+
load_best_model_at_end: true
|
| 126 |
+
save_total_limit: 2
|
| 127 |
+
seed: 42
|
| 128 |
+
remove_unused_columns: false
|
| 129 |
+
max_grad_norm: 1.0
|
| 130 |
+
weight_decay: 0.01
|
| 131 |
+
torch_compile: false
|
| 132 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|