gurgutan commited on
Commit
979bb8b
1 Parent(s): f2d688b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +47 -1
README.md CHANGED
@@ -4,4 +4,50 @@ language:
4
  - ru
5
  - en
6
  library_name: transformers
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - ru
5
  - en
6
  library_name: transformers
7
+ ---
8
+
9
+ tags:
10
+ - gpt3
11
+ - transformers
12
+ ---
13
+ # ruGPT-13B-4bit
14
+
15
+ This files are GPTQ model files for sberbank [ruGPT-3.5-13B](https://huggingface.co/ai-forever/ruGPT-3.5-13B) model.
16
+
17
+ ## Technical details
18
+
19
+ Model was quantized to 4-bit
20
+
21
+ ## Examples of usage
22
+
23
+ First make sure you have AutoGPTQ installed:
24
+
25
+ GITHUB_ACTIONS=true pip install auto-gptq
26
+
27
+ Then try the following example code:
28
+
29
+ ```python
30
+ from transformers import AutoTokenizer, TextGenerationPipeline
31
+ from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
32
+
33
+ repo_name = "gurgutan/ruGPT-13B-4bit"
34
+
35
+ # load tokenizer from Hugging Face Hub
36
+ tokenizer = AutoTokenizer.from_pretrained(repo_name, use_fast=True)
37
+
38
+ # download quantized model from Hugging Face Hub and load to the first GPU
39
+ model = AutoGPTQForCausalLM.from_quantized(repo_name, device="cuda:0", use_safetensors=True, use_triton=False)
40
+
41
+ # inference with model.generate
42
+ request = "Буря мглою небо кроет"
43
+ print(tokenizer.decode(model.generate(**tokenizer(request, return_tensors="pt").to(model.device))[0]))
44
+
45
+ # or you can also use pipeline
46
+ pipeline = TextGenerationPipeline(model=model, tokenizer=tokenizer)
47
+ print(pipeline(request)[0]["generated_text"])
48
+
49
+ ```
50
+
51
+ # Original model: [ruGPT-3.5 13B](https://huggingface.co/ai-forever/ruGPT-3.5-13B)
52
+
53
+ Language model for Russian. Model has 13B parameters as you can guess from it's name. This is our biggest model so far and it was used for trainig GigaChat (read more about it in the [article](https://habr.com/ru/companies/sberbank/articles/730108/)).