File size: 1,336 Bytes
17a8e50
 
ad7a3b4
 
 
 
 
 
 
 
4be0a6b
 
17a8e50
c8adb80
 
 
17c541d
 
c8adb80
17c541d
 
6ac7ced
983620d
17c541d
 
 
 
 
 
8137326
17c541d
 
 
 
 
9ff0e26
c8adb80
 
 
 
afe50ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
---
library_name: transformers
license: apache-2.0
datasets:
- Vikhrmodels/GrandMaster-PRO-MAX
language:
- ru
base_model:
- HuggingFaceTB/SmolLM2-360M-Instruct
pipeline_tag: text-generation
tags:
- rag
---

## Versions

v1: SFT -- 7658aab7702e56d9f5fa3b33bf7adcdae92f536b

## Example

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "belyakoff/SmolLM2-360M-Instruct-FT"

device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)

messages = [{"role": "user", "content": "Столица России?"}]
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
print(input_text)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0]))
# Столица России — Москва. Это один из самых известных и культурно значимых городов в мире.
```

## Limitations

Don't change system prompt. Changing system prompt will make the model go crazy.