rowjak commited on
Commit
c2e0952
1 Parent(s): 5d1c9d2

change code sample

Browse files
Files changed (1) hide show
  1. README.md +3 -7
README.md CHANGED
@@ -33,17 +33,13 @@ ARTICLE = ""
33
  # generate summary
34
  input_ids = tokenizer.encode(ARTICLE, return_tensors='pt')
35
  summary_ids = model.generate(input_ids,
36
- max_length=150,
37
- num_beams=10,
38
  repetition_penalty=2.5,
39
  length_penalty=1.0,
40
  early_stopping=True,
41
  no_repeat_ngram_size=2,
42
- use_cache=True,
43
- do_sample = True,
44
- temperature = 0.8,
45
- top_k = 50,
46
- top_p = 0.95)
47
 
48
  summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
49
  print(summary_text)
 
33
  # generate summary
34
  input_ids = tokenizer.encode(ARTICLE, return_tensors='pt')
35
  summary_ids = model.generate(input_ids,
36
+ max_length=100,
37
+ num_beams=2,
38
  repetition_penalty=2.5,
39
  length_penalty=1.0,
40
  early_stopping=True,
41
  no_repeat_ngram_size=2,
42
+ use_cache=True)
 
 
 
 
43
 
44
  summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
45
  print(summary_text)