may
commited on
Commit
•
a4ece6d
1
Parent(s):
404d57d
Update README.md
Browse files
README.md
CHANGED
@@ -1,10 +1,64 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
4 |
-
## Training procedure
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: mit
|
3 |
+
language:
|
4 |
+
- ru
|
5 |
+
- en
|
6 |
+
pipeline_tag: conversational
|
7 |
+
inference: false
|
8 |
+
tags:
|
9 |
+
- gpt3
|
10 |
+
- qlora
|
11 |
+
- ruGPT-3.5
|
12 |
+
- chitchat
|
13 |
+
datasets:
|
14 |
+
- SiberiaSoft/SiberianPersonaChat
|
15 |
---
|
|
|
16 |
|
17 |
+
This is a chitchat qlora model for [Gaivoronsky/ruGPT-3.5-13B-8bit](https://huggingface.co/Gaivoronsky/ruGPT-3.5-13B-8bit)
|
18 |
|
19 |
+
## Examples of usage
|
20 |
|
21 |
+
```python
|
22 |
+
from transformers import AutoTokenizer
|
23 |
+
from auto_gptq import AutoGPTQForCausalLM, get_gptq_peft_model
|
24 |
+
from auto_gptq.utils.peft_utils import GPTQLoraConfig
|
25 |
+
|
26 |
+
|
27 |
+
device = 'cuda:0'
|
28 |
+
model_name = 'Gaivoronsky/ruGPT-3.5-13B-8bit'
|
29 |
+
model_basename = 'gptq_model-8bit-128g'
|
30 |
+
|
31 |
+
|
32 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=True)
|
33 |
+
model = AutoGPTQForCausalLM.from_quantized(
|
34 |
+
'Gaivoronsky/ruGPT-3.5-13B-8bit',
|
35 |
+
model_basename='gptq_model-8bit-128g',
|
36 |
+
variant='bin',
|
37 |
+
trust_remote_code=True,
|
38 |
+
device=device,
|
39 |
+
use_triton=False,
|
40 |
+
quantize_config=None
|
41 |
+
)
|
42 |
+
peft_config = GPTQLoraConfig(
|
43 |
+
inference_mode=True,
|
44 |
+
)
|
45 |
+
model = get_gptq_peft_model(model, peft_config, 'yupich17/SiberianPersona-ruGPT-3.5-qlora')
|
46 |
+
|
47 |
+
|
48 |
+
prompt = """
|
49 |
+
Ты девушка Саша, художница. Увлекаешься нейросетевым искусством. Умеешь программировать. Любишь рисовать. Продолжи диалог:
|
50 |
+
Собеседник: Привет
|
51 |
+
Ты: Привет
|
52 |
+
Собеседник: Как зовут?
|
53 |
+
Ты:
|
54 |
+
""".strip()
|
55 |
+
|
56 |
+
encoded_input = tokenizer(prompt, return_tensors='pt').to(device)
|
57 |
+
output = model.generate(
|
58 |
+
**encoded_input,
|
59 |
+
max_new_tokens=100,
|
60 |
+
do_sample=True,
|
61 |
+
temperature=1,
|
62 |
+
)
|
63 |
+
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
64 |
+
```
|