JanviMl commited on
Commit
7fa4f70
·
verified ·
1 Parent(s): dc21f12

Update paraphraser.py

Browse files
Files changed (1) hide show
  1. paraphraser.py +1 -1
paraphraser.py CHANGED
@@ -34,7 +34,7 @@ def paraphrase_comment(comment):
34
  # Generate the paraphrased comment with optimized parameters
35
  outputs = model.generate(
36
  **inputs,
37
- max_length=50, # Reduced max_length for short comments
38
  num_beams=4, # Use beam search for faster and more consistent generation
39
  early_stopping=True, # Stop generation once a good sequence is found
40
  do_sample=False # Disable sampling to use beam search
 
34
  # Generate the paraphrased comment with optimized parameters
35
  outputs = model.generate(
36
  **inputs,
37
+ max_new_tokens=50, # Specify the number of new tokens to generate (excludes input length)
38
  num_beams=4, # Use beam search for faster and more consistent generation
39
  early_stopping=True, # Stop generation once a good sequence is found
40
  do_sample=False # Disable sampling to use beam search