Update README.md
Browse filesUpdate sample code at model card
README.md
CHANGED
@@ -32,13 +32,13 @@ ARTICLE_TO_SUMMARIZE = "Secara umum, dispepsia adalah kumpulan gejala pada salur
|
|
32 |
# generate summary
|
33 |
input_ids = tokenizer.encode(ARTICLE_TO_SUMMARIZE, return_tensors='pt')
|
34 |
summary_ids = model.generate(input_ids,
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
43 |
print(summary_text)
|
44 |
```
|
|
|
32 |
# generate summary
|
33 |
input_ids = tokenizer.encode(ARTICLE_TO_SUMMARIZE, return_tensors='pt')
|
34 |
summary_ids = model.generate(input_ids,
|
35 |
+
max_length=100,
|
36 |
+
num_beams=2,
|
37 |
+
repetition_penalty=2.5,
|
38 |
+
length_penalty=1.0,
|
39 |
+
early_stopping=True,
|
40 |
+
no_repeat_ngram_size=2,
|
41 |
+
use_cache=True)
|
42 |
summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
|
43 |
print(summary_text)
|
44 |
```
|