Update README.md
Browse files
README.md
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
---
|
2 |
-
license: afl-3.0
|
3 |
-
language: uk
|
4 |
-
---
|
5 |
-
## GPT2 being trained on Ukrainian news.
|
6 |
-
|
7 |
-
### General info:
|
8 |
-
The model is not ready yet
|
9 |
-
|
10 |
-
### Example of usage:
|
11 |
-
```python
|
12 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
13 |
-
|
14 |
-
tokenizer = AutoTokenizer.from_pretrained("kyryl0s/gpt2-uk-xxs")
|
15 |
-
model = AutoModelForCausalLM.from_pretrained("kyryl0s/gpt2-uk-xxs")
|
16 |
-
input_ids = tokenizer.encode("Путін — ", add_special_tokens=False, return_tensors='pt')
|
17 |
-
outputs = model.generate(
|
18 |
-
input_ids,
|
19 |
-
do_sample=True,
|
20 |
-
num_return_sequences=3,
|
21 |
-
max_length=50
|
22 |
-
)
|
23 |
-
for i, out in enumerate(outputs):
|
24 |
-
print("{}: {}".format(i, tokenizer.decode(out)))
|
25 |
-
|
26 |
```
|
|
|
1 |
+
---
|
2 |
+
license: afl-3.0
|
3 |
+
language: uk
|
4 |
+
---
|
5 |
+
## GPT2 being trained on Ukrainian news.
|
6 |
+
|
7 |
+
### General info:
|
8 |
+
The model is not ready yet but I'm working on it. It also has a relatively small context window, which makes it quite uninteresting.
|
9 |
+
|
10 |
+
### Example of usage:
|
11 |
+
```python
|
12 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
13 |
+
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained("kyryl0s/gpt2-uk-xxs")
|
15 |
+
model = AutoModelForCausalLM.from_pretrained("kyryl0s/gpt2-uk-xxs")
|
16 |
+
input_ids = tokenizer.encode("Путін — ", add_special_tokens=False, return_tensors='pt')
|
17 |
+
outputs = model.generate(
|
18 |
+
input_ids,
|
19 |
+
do_sample=True,
|
20 |
+
num_return_sequences=3,
|
21 |
+
max_length=50
|
22 |
+
)
|
23 |
+
for i, out in enumerate(outputs):
|
24 |
+
print("{}: {}".format(i, tokenizer.decode(out)))
|
25 |
+
|
26 |
```
|