vltnmmdv commited on
Commit
86b1b2b
·
verified ·
1 Parent(s): 0ee679f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +54 -3
README.md CHANGED
@@ -1,3 +1,54 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ base_model:
4
+ - ai-sage/GigaChat-20B-A3B-instruct
5
+ language:
6
+ - ru
7
+ - en
8
+ ---
9
+ # GigaChat-20B-A3B-instruct-v1.5 bf16
10
+
11
+ Диалоговая модель из семейства моделей GigaChat, основная на [ai-sage/GigaChat-20B-A3B-instruct-v1.5](https://huggingface.co/ai-sage/GigaChat-20B-A3B-instruct-v1.5). Поддерживает контекст в 131 тысячу токенов.
12
+
13
+ Представляем обновленную версию с улучшенным alignment, что привело к значительному росту метрик арен:
14
+ - Arena Hard RU: 20.8 → 29.6 (+8.8)
15
+ - Arena General: 41.1 → 49.1 (+9)
16
+ - остальные метрики на тех же значениях
17
+
18
+ Больше подробностей в [хабр статье](https://habr.com/en/companies/sberdevices/articles/865996/) и в карточке оригинальной instruct модели.
19
+
20
+ ## Доступность
21
+
22
+ **Для данной модели также доступны веса в [fp32](https://huggingface.co/ai-sage/GigaChat-20B-A3B-instruct-v1.5) и [int8](https://huggingface.co/ai-sage/GigaChat-20B-A3B-instruct-v1.5-int8)**
23
+
24
+ А также:
25
+ - GGUF версии ([bf16, q8, q6, q5, q4](https://huggingface.co/ai-sage/GigaChat-20B-A3B-instruct-v1.5-GGUF))
26
+ - Ollama ([bf16, q8, q6, q5, q4](https://ollama.com/infidelis/GigaChat-20B-A3B-instruct-v1.5))
27
+
28
+
29
+ ## Пример использования через transformers
30
+
31
+ ```bash
32
+ pip install --upgrade transformers torch accelerate bitsandbytes
33
+ ```
34
+
35
+
36
+ ```python
37
+ import torch
38
+ from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
39
+
40
+ model_name = "ai-sage/GigaChat-20B-A3B-instruct-bf16"
41
+ tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
42
+ model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, device_map="auto", torch_dtype=torch.bfloat16)
43
+ model.generation_config = GenerationConfig.from_pretrained(model_name)
44
+
45
+ messages = [
46
+ {"role": "user", "content": "Докажи теорему о неподвижной точке"}
47
+ ]
48
+ input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
49
+ outputs = model.generate(input_tensor.to(model.device))
50
+
51
+ result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=False)
52
+ print(result)
53
+ ```
54
+