File size: 941 Bytes
8d3bbeb d557a0b 8d3bbeb 715094b d557a0b 5e15d8e 613c95d f8d9673 d557a0b 48d7f20 d557a0b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
---
license: afl-3.0
language: uk
---
## GPT2 trained to generate ЗНО (Ukrainian exam SAT type of thing) essays
Generated texts are not very cohesive yet but I'm working on it.
The Hosted inference API outputs (on the right) are too short for some reason. Trying to fix it.
Use the code from the example below. The model takes "ZNOTITLE: your essay title" inputs.
### Example of usage:
```python
from transformers import AlbertTokenizer, GPT2LMHeadModel
tokenizer = AlbertTokenizer.from_pretrained("kyryl0s/gpt2-uk-zno-edition")
model = GPT2LMHeadModel.from_pretrained("kyryl0s/gpt2-uk-zno-edition")
input_ids = tokenizer.encode("ZNOTITLE: Чи можна трахатися?", add_special_tokens=False, return_tensors='pt')
outputs = model.generate(
input_ids,
do_sample=True,
num_return_sequences=1,
max_length=250
)
for i, out in enumerate(outputs):
print("{}: {}".format(i, tokenizer.decode(out)))
``` |