Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
c76450e2
Unverified
Commit
c76450e2
authored
May 20, 2020
by
Oleksandr Bushkovskyi
Committed by
GitHub
May 20, 2020
Browse files
Model card for Tereveni-AI/gpt2-124M-uk-fiction (#4470)
Create model card for "Tereveni-AI/gpt2-124M-uk-fiction" model
parent
9907dc52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
model_cards/Tereveni-AI/gpt2-124M-uk-fiction/README.md
model_cards/Tereveni-AI/gpt2-124M-uk-fiction/README.md
+23
-0
No files found.
model_cards/Tereveni-AI/gpt2-124M-uk-fiction/README.md
0 → 100644
View file @
c76450e2
Note:
**default code snippet above won't work**
because we are using
`AlbertTokenizer`
with
`GPT2LMHeadModel`
, see
[
issue
](
https://github.com/huggingface/transformers/issues/4285
)
.
## GPT2 124M Trained on Ukranian Fiction
Example usage:
```
python
from
transformers
import
AlbertTokenizer
,
GPT2LMHeadModel
tokenizer
=
AlbertTokenizer
.
from_pretrained
(
"Tereveni-AI/gpt2-124M-uk-fiction"
)
model
=
GPT2LMHeadModel
.
from_pretrained
(
"Tereveni-AI/gpt2-124M-uk-fiction"
)
input_ids
=
tokenizer
.
encode
(
'Но зла Юнона, суча дочка,'
,
add_special_tokens
=
False
,
return_tensors
=
'pt'
)
outputs
=
model
.
generate
(
input_ids
,
do_sample
=
True
,
num_return_sequences
=
3
,
max_length
=
50
)
for
i
,
out
in
enumerate
(
outputs
):
print
(
'{}: {}'
.
format
(
i
,
tokenizer
.
decode
(
out
)))
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment