Commit
•
efc5a1b
1
Parent(s):
648ffee
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- IlyaGusev/rulm
|
5 |
+
inference:
|
6 |
+
parameters:
|
7 |
+
min_length: 20
|
8 |
+
max_new_tokens: 250
|
9 |
+
top_k: 50
|
10 |
+
top_p: 0.9
|
11 |
+
early_stopping: true
|
12 |
+
no_repeat_ngram_size: 2
|
13 |
+
use_cache: true
|
14 |
+
repetition_penalty: 1.5
|
15 |
+
length_penalty: 0.8
|
16 |
+
num_beams: 2
|
17 |
+
language:
|
18 |
+
- ru
|
19 |
+
library_name: transformers
|
20 |
+
pipeline_tag: text-generation
|
21 |
+
tags:
|
22 |
+
- finance
|
23 |
+
- code
|
24 |
+
---
|
25 |
+
|
26 |
+
<h1 style="font-size: 42px">WortegaLM 109m<h1/>
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
# Model Summary
|
31 |
+
|
32 |
+
> Это GPTneo like модель обученная с нуля на сете в 95gb кода, хабра, пикабу, новостей(порядка 12B токенов) Она умеет решать примитивные задачи, не пригодна для ZS FS, но идеальна как модель для студенческих проектов
|
33 |
+
|
34 |
+
# Quick Start
|
35 |
+
|
36 |
+
|
37 |
+
```python
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM,
|
44 |
+
|
45 |
+
|
46 |
+
tokenizer = AutoTokenizer.from_pretrained('AlexWortega/wortegaLM',padding_side='left')
|
47 |
+
device = 'cuda'
|
48 |
+
model = AutoModelForCausalLM.from_pretrained('AlexWortega/wortegaLM')
|
49 |
+
model.resize_token_embeddings(len(tokenizer))
|
50 |
+
model.to(device)
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
def generate_seqs(q,model, k=2):
|
55 |
+
gen_kwargs = {
|
56 |
+
"min_length": 20,
|
57 |
+
"max_new_tokens": 100,
|
58 |
+
"top_k": 50,
|
59 |
+
"top_p": 0.7,
|
60 |
+
"do_sample": True,
|
61 |
+
"early_stopping": True,
|
62 |
+
"no_repeat_ngram_size": 2,
|
63 |
+
"eos_token_id": tokenizer.eos_token_id,
|
64 |
+
"pad_token_id": tokenizer.eos_token_id,
|
65 |
+
"use_cache": True,
|
66 |
+
"repetition_penalty": 1.5,
|
67 |
+
"length_penalty": 1.2,
|
68 |
+
"num_beams": 4,
|
69 |
+
"num_return_sequences": k
|
70 |
+
}
|
71 |
+
|
72 |
+
t = tokenizer.encode(q, add_special_tokens=False, return_tensors='pt').to(device)
|
73 |
+
g = model.generate(t, **gen_kwargs)
|
74 |
+
generated_sequences = tokenizer.batch_decode(g, skip_special_tokens=False)
|
75 |
+
|
76 |
+
return generated_sequences
|
77 |
+
|
78 |
+
```
|
79 |
+
|