Update README.md
Browse files
README.md
CHANGED
@@ -50,14 +50,14 @@ Not mentioned parameters are the same as for GPT-2.
|
|
50 |
|
51 |
## Usage
|
52 |
```python
|
53 |
-
from transformers import AutoTokenizer,
|
54 |
import torch
|
55 |
|
56 |
t = AutoTokenizer.from_pretrained("BUT-FIT/Czech-GPT-2-XL-133k")
|
57 |
-
m =
|
58 |
|
59 |
# Try the model inference
|
60 |
-
prompt = "
|
61 |
input_ids = t.encode(prompt, return_tensors="pt")
|
62 |
with torch.no_grad():
|
63 |
generated_text = m.generate(input_ids=input_ids,
|
|
|
50 |
|
51 |
## Usage
|
52 |
```python
|
53 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
54 |
import torch
|
55 |
|
56 |
t = AutoTokenizer.from_pretrained("BUT-FIT/Czech-GPT-2-XL-133k")
|
57 |
+
m = AutoModelForCausalLM.from_pretrained("BUT-FIT/Czech-GPT-2-XL-133k").eval()
|
58 |
|
59 |
# Try the model inference
|
60 |
+
prompt = "Nejznámějším českým spisovatelem "
|
61 |
input_ids = t.encode(prompt, return_tensors="pt")
|
62 |
with torch.no_grad():
|
63 |
generated_text = m.generate(input_ids=input_ids,
|