Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- ru
|
| 4 |
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- text-generation
|
| 7 |
+
- pytorch
|
| 8 |
+
- qwen2
|
| 9 |
+
- russian
|
| 10 |
+
- tensor
|
| 11 |
+
- instruct
|
| 12 |
+
- sft
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# Tensor-2-40m-instruct
|
| 17 |
+
|
| 18 |
+
Tensor-2-40m-instruct is a Russian-language language model from the **Tensor** series, developed as part of the **GribAI** project. This is an instruction-tuned version of [Tensor-2-40m-base](https://huggingface.co/VGribAI/Tensor-2-40m-base), fine-tuned to follow instructions and hold a dialogue.
|
| 19 |
+
|
| 20 |
+
## Description
|
| 21 |
+
|
| 22 |
+
Built on top of Tensor-2-40m-base, this model was additionally fine-tuned on a **150 MB** SFT (supervised fine-tuning) dataset, including code-related data. As a result, it follows instructions more reliably and handles code-related prompts better than the base model.
|
| 23 |
+
|
| 24 |
+
## Training
|
| 25 |
+
|
| 26 |
+
- Base model: Tensor-2-40m-base
|
| 27 |
+
- SFT dataset: 150 MB, including code
|
| 28 |
+
- Stage: supervised fine-tuning (SFT)
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 34 |
+
|
| 35 |
+
model_name = "VGribAI/Tensor-2-40m-instruct"
|
| 36 |
+
|
| 37 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 38 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 39 |
+
|
| 40 |
+
prompt = "Напиши функцию на Python, которая считает факториал числа"
|
| 41 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 42 |
+
output = model.generate(**inputs, max_new_tokens=200)
|
| 43 |
+
|
| 44 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Limitations
|
| 48 |
+
|
| 49 |
+
As a small model, it may still make mistakes in complex reasoning, long-context tasks, or less common domains. Always verify generated code before running it.
|
| 50 |
+
**GribAI** project (VGribAI).
|