Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- ru
|
4 |
+
base_model:
|
5 |
+
- t-tech/T-lite-it-1.0
|
6 |
+
---
|
7 |
+
**_This is a converted version of the original [T-lite-it-1.0](https://huggingface.co/t-tech/T-lite-it-1.0) model into EXL2._**
|
8 |
+
|
9 |
+
|
10 |
+
# Original model card:
|
11 |
+
|
12 |
+
# T-lite-it-1.0
|
13 |
+
|
14 |
+
**🚨 T-lite is designed for further fine-tuning and is not intended as a ready-to-use conversational assistant. Users are advised to exercise caution and are responsible for any additional training and oversight required to ensure the model's responses meet acceptable ethical and safety standards. The responsibility for incorporating this model into industrial or commercial solutions lies entirely with those who choose to deploy it.**
|
15 |
+
|
16 |
+
|
17 |
+
## Description
|
18 |
+
|
19 |
+
T-lite-it-1.0 is a model built upon the Qwen 2.5 model family and incorporates both continual pre-training and alignment techniques.
|
20 |
+
|
21 |
+
### 📚 Dataset
|
22 |
+
|
23 |
+
Pre-training Stage 1:
|
24 |
+
100B tokens, consisting of diverse Russian data from Common Crawl, books, code, and proprietary datasets, mixed with re-played English data (English added as it is the primary language of the base model).
|
25 |
+
|
26 |
+
Pre-training Stage 2:
|
27 |
+
40B tokens, a mix of instruction and pre-training data.
|
28 |
+
|
29 |
+
Supervised Fine-Tuning (SFT):
|
30 |
+
1B tokens, a mix of diverse instruction data.
|
31 |
+
|
32 |
+
Preference Tuning:
|
33 |
+
1B tokens, training the model to be helpful.
|
34 |
+
|
35 |
+
## 📊 Benchmarks
|
36 |
+
|
37 |
+
| Benchmark | T-lite-it-1.0 | Qwen-2.5-7B-Instruct | GigaChat Pro 1.0.26.15 | RuAdapt-Qwen-7B-Instruct-v1 | gemma-2-9b-it |
|
38 |
+
|------------------------------------------------|:-------------:|:--------------------:|:----------------------:|:---------------------------:|:--------------|
|
39 |
+
| [MERA](https://mera.a-ai.ru) | **0.552** | 0.482 | 0.512 | 0.468 | 0.505 |
|
40 |
+
| [MaMuRaMu](https://mera.a-ai.ru/ru/tasks/22) | **0.775** | 0.711 | 0.77 | 0.7 | 0.724 |
|
41 |
+
| ruMMLU-PRO | **0.497** | 0.481 | - | 0.448 | 0.405 |
|
42 |
+
| ruGSM8K | **0.856** | 0.832 | 0.752 | 0.795 | 0.823 |
|
43 |
+
| ruMATH | **0.679** | 0.671 | 0.418 | 0.607 | 0.473 |
|
44 |
+
| ruMBPP | **0.693** | 0.685 | 0.412 | 0.696 | 0.63 |
|
45 |
+
| [ruCodeEval](https://mera.a-ai.ru/ru/tasks/23) | 0.082 / 0.168 / 0.226 | 0.025 / 0.071 / 0.098 | 0.056 / 0.068 / 0.073 | 0.018 / 0.064 / 0.11 | **0.215 / 0.494 / 0.561** |
|
46 |
+
| Arena-Hard-Ru | **64.38** | 54.29 | - | 52.77 | 47.83 |
|
47 |
+
| MT Bench Ru | 7.87 | 7.33 | **8.21** | 7.62 | 7.4 |
|
48 |
+
| Alpaca Eval Ru | **39.61** | 25.61 | 29.83 | 28.43 | 36.87 |
|
49 |
+
|
50 |
+
Detailed evaluation results can be found in our [habr post](https://habr.com/ru/companies/tbank/articles/865582/)
|
51 |
+
|
52 |
+
|
53 |
+
## 👨💻 Examples of usage
|
54 |
+
|
55 |
+
### HF Usage
|
56 |
+
|
57 |
+
```python
|
58 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
59 |
+
import torch
|
60 |
+
torch.manual_seed(42)
|
61 |
+
model_name = "t-tech/T-lite-it-1.0"
|
62 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
63 |
+
model = AutoModelForCausalLM.from_pretrained(
|
64 |
+
model_name,
|
65 |
+
torch_dtype="auto",
|
66 |
+
device_map="auto"
|
67 |
+
)
|
68 |
+
prompt = "Напиши стих про машинное обучение"
|
69 |
+
messages = [
|
70 |
+
{"role": "system", "content": "Ты T-lite, виртуальный ассистент в Т-Технологии. Твоя задача - быть полезным диалоговым ассистентом."},
|
71 |
+
{"role": "user", "content": prompt}
|
72 |
+
]
|
73 |
+
text = tokenizer.apply_chat_template(
|
74 |
+
messages,
|
75 |
+
tokenize=False,
|
76 |
+
add_generation_prompt=True
|
77 |
+
)
|
78 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
79 |
+
generated_ids = model.generate(
|
80 |
+
**model_inputs,
|
81 |
+
max_new_tokens=256
|
82 |
+
)
|
83 |
+
generated_ids = [
|
84 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
85 |
+
]
|
86 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
87 |
+
print(response)
|
88 |
+
```
|
89 |
+
|
90 |
+
Output:
|
91 |
+
```
|
92 |
+
В мире данных, где цифры танцуют,
|
93 |
+
Машинное обученье — ведущий вальс.
|
94 |
+
Алгоритмы учатся, как дети,
|
95 |
+
На примерах, как на сказочных страницах.
|
96 |
+
Они ищут закономерности в потоках,
|
97 |
+
Как мудрецы в древних свитках.
|
98 |
+
С каждым шагом всё точнее предсказания,
|
99 |
+
Вот так, словно волшебство, оживает.
|
100 |
+
Обучаясь на ошибках, они растут,
|
101 |
+
Из просты�� моделей в сложные формы.
|
102 |
+
Каждый новый пример — как новая строка,
|
103 |
+
В книге знаний, что не знает конца.
|
104 |
+
Не бойтесь перемен, ведь это — путь,
|
105 |
+
Который ведёт к будущему, светлому и новому.
|
106 |
+
Машинное обученье — наш проводник,
|
107 |
+
В этом мире, где технологии царят.
|
108 |
+
```
|
109 |
+
|
110 |
+
### VLLM Usage
|
111 |
+
|
112 |
+
```python
|
113 |
+
from transformers import AutoTokenizer
|
114 |
+
from vllm import LLM, SamplingParams
|
115 |
+
model_name = "t-tech/T-lite-it-1.0"
|
116 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
117 |
+
llm = LLM(model=model_name, max_model_len=8192)
|
118 |
+
sampling_params = SamplingParams(temperature=0.7,
|
119 |
+
repetition_penalty=1.05,
|
120 |
+
top_p=0.8, top_k=70)
|
121 |
+
prompt = "Напиши стих про машинное обучение"
|
122 |
+
messages = [
|
123 |
+
{"role": "system", "content": "Ты T-lite, виртуальный ассистент в Т-Технологии. Твоя задача - быть полезным диалоговым ассистентом."},
|
124 |
+
{"role": "user", "content": prompt}
|
125 |
+
]
|
126 |
+
prompt_token_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
|
127 |
+
outputs = llm.generate(prompt_token_ids=prompt_token_ids, sampling_params=sampling_params)
|
128 |
+
generated_text = [output.outputs[0].text for output in outputs]
|
129 |
+
print(generated_text)
|
130 |
+
```
|