| --- |
| language: |
| - ru |
| license: mit |
| tags: |
| - text-generation |
| - pytorch |
| - qwen2 |
| - russian |
| - tensor |
| - instruct |
| - sft |
| pipeline_tag: text-generation |
| --- |
| |
| # Tensor-2-40m-instruct |
|
|
| 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. |
|
|
| ## Description |
|
|
| 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. |
|
|
| ## Training |
|
|
| - Base model: Tensor-2-40m-base |
| - SFT dataset: 150 MB, including code |
| - Stage: supervised fine-tuning (SFT) |
|
|
| ## Usage |
|
|
| ```python |
| from transformers import AutoModelForCausalLM, AutoTokenizer |
| |
| model_name = "VGribAI/Tensor-2-40m-instruct" |
| |
| tokenizer = AutoTokenizer.from_pretrained(model_name) |
| model = AutoModelForCausalLM.from_pretrained(model_name) |
| |
| prompt = "Напиши функцию на Python, которая считает факториал числа" |
| inputs = tokenizer(prompt, return_tensors="pt") |
| output = model.generate(**inputs, max_new_tokens=200) |
| |
| print(tokenizer.decode(output[0], skip_special_tokens=True)) |
| ``` |
|
|
| ## Limitations |
|
|
| 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. |
| **GribAI** project (VGribAI). |