panggi commited on
Commit
5a2c5ae
1 Parent(s): 55bd7b9

Update README.md

Browse files

Update sample code at model card

Files changed (1) hide show
  1. README.md +7 -7
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
- max_length=100,
36
- do_sample=True,
37
- no_repeat_ngram_size=2,
38
- early_stopping=True,
39
- temperature = 0.8,
40
- top_k = 50,
41
- top_p = 0.95)
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
  ```