Update README.md
Browse files
README.md
CHANGED
@@ -16,12 +16,12 @@ pip install transformers
|
|
16 |
|
17 |
# Example
|
18 |
```python
|
19 |
-
from transformers import
|
20 |
|
21 |
-
model =
|
22 |
tokenizer = AutoTokenizer.from_pretrained("satjawat/pegasus-x-thai-sum")
|
23 |
|
24 |
-
new_input_string = "
|
25 |
new_input_ids = tokenizer(new_input_string.lower(), return_tensors="pt").input_ids
|
26 |
summary_ids = model.generate(new_input_ids, max_length=50, num_beams=6, length_penalty=2.0, early_stopping=True)
|
27 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
|
|
16 |
|
17 |
# Example
|
18 |
```python
|
19 |
+
from transformers import PegasusXForConditionalGeneration, AutoTokenizer
|
20 |
|
21 |
+
model = PegasusXForConditionalGeneration.from_pretrained("satjawat/pegasus-x-thai-sum")
|
22 |
tokenizer = AutoTokenizer.from_pretrained("satjawat/pegasus-x-thai-sum")
|
23 |
|
24 |
+
new_input_string = "ข้อความ"
|
25 |
new_input_ids = tokenizer(new_input_string.lower(), return_tensors="pt").input_ids
|
26 |
summary_ids = model.generate(new_input_ids, max_length=50, num_beams=6, length_penalty=2.0, early_stopping=True)
|
27 |
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|