Commit
•
bf0db0a
1
Parent(s):
c452b04
Update README.md
Browse files
README.md
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
---
|
2 |
language:
|
3 |
-
-
|
4 |
-
thumbnail: https://huggingface.co/macedonizer/
|
5 |
license: Apache 2.0
|
6 |
datasets:
|
7 |
-
- wiki-
|
8 |
---
|
9 |
|
10 |
-
#
|
11 |
Test the whole generation capabilities here: https://transformer.huggingface.co/doc/gpt2-large
|
12 |
Pretrained model on English language using a causal language modeling (CLM) objective. It was introduced in
|
13 |
[this paper](https://d4mucfpksywv.cloudfront.net/better-language-models/language_models_are_unsupervised_multitask_learners.pdf)
|
14 |
and first released at [this page](https://openai.com/blog/better-language-models/).
|
15 |
|
16 |
## Model description
|
17 |
-
|
18 |
means it was pretrained on the raw texts only, with no humans labeling them in any way (which is why it can use lots
|
19 |
of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely,
|
20 |
it was trained to guess the next word in sentences.
|
@@ -28,13 +28,12 @@ prompt.
|
|
28 |
### How to use
|
29 |
Here is how to use this model to get the features of a given text in PyTorch:
|
30 |
|
31 |
-
import random
|
32 |
-
from transformers import AutoTokenizer, AutoModelWithLMHead
|
33 |
|
34 |
-
tokenizer = AutoTokenizer.from_pretrained('macedonizer/
|
35 |
model = AutoModelWithLMHead.from_pretrained('macedonizer/sr-gpt2')
|
36 |
|
37 |
-
input_text = '
|
38 |
|
39 |
if len(input_text) == 0: \
|
40 |
encoded_input = tokenizer(input_text, return_tensors="pt") \
|
@@ -48,7 +47,7 @@ if len(input_text) == 0: \
|
|
48 |
) \
|
49 |
else: \
|
50 |
encoded_input = tokenizer(input_text, return_tensors="pt") \
|
51 |
-
|
52 |
**encoded_input, \
|
53 |
bos_token_id=random.randint(1, 50000), \
|
54 |
do_sample=True, \
|
|
|
1 |
---
|
2 |
language:
|
3 |
+
- hr
|
4 |
+
thumbnail: https://huggingface.co/macedonizer/hr-gpt2/lets-talk-about-nlp-hr.jpg
|
5 |
license: Apache 2.0
|
6 |
datasets:
|
7 |
+
- wiki-hr
|
8 |
---
|
9 |
|
10 |
+
# hr-gpt2
|
11 |
Test the whole generation capabilities here: https://transformer.huggingface.co/doc/gpt2-large
|
12 |
Pretrained model on English language using a causal language modeling (CLM) objective. It was introduced in
|
13 |
[this paper](https://d4mucfpksywv.cloudfront.net/better-language-models/language_models_are_unsupervised_multitask_learners.pdf)
|
14 |
and first released at [this page](https://openai.com/blog/better-language-models/).
|
15 |
|
16 |
## Model description
|
17 |
+
hr-gpt2 is a transformers model pretrained on a very large corpus of Croation data in a self-supervised fashion. This
|
18 |
means it was pretrained on the raw texts only, with no humans labeling them in any way (which is why it can use lots
|
19 |
of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely,
|
20 |
it was trained to guess the next word in sentences.
|
|
|
28 |
### How to use
|
29 |
Here is how to use this model to get the features of a given text in PyTorch:
|
30 |
|
31 |
+
import random \\nfrom transformers import AutoTokenizer, AutoModelWithLMHead
|
|
|
32 |
|
33 |
+
tokenizer = AutoTokenizer.from_pretrained('macedonizer/hr-gpt2') \
|
34 |
model = AutoModelWithLMHead.from_pretrained('macedonizer/sr-gpt2')
|
35 |
|
36 |
+
input_text = 'Ja sam bio '
|
37 |
|
38 |
if len(input_text) == 0: \
|
39 |
encoded_input = tokenizer(input_text, return_tensors="pt") \
|
|
|
47 |
) \
|
48 |
else: \
|
49 |
encoded_input = tokenizer(input_text, return_tensors="pt") \
|
50 |
+
output = model.generate( \
|
51 |
**encoded_input, \
|
52 |
bos_token_id=random.randint(1, 50000), \
|
53 |
do_sample=True, \
|