vijay399 commited on
Commit
e7fec2e
·
1 Parent(s): 38b6bd6

Update src/paraphrase/Paraphrase.py

Browse files
Files changed (1) hide show
  1. src/paraphrase/Paraphrase.py +2 -1
src/paraphrase/Paraphrase.py CHANGED
@@ -22,7 +22,7 @@ def paraphraseParaphraseMethod(requestValue : str):
22
  for SENTENCE in tokenized_sent_list:
23
  text = "paraphrase: " + SENTENCE
24
 
25
- encoding = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
26
  input_ids, attention_masks = encoding["input_ids"], encoding["attention_mask"]
27
 
28
  beam_outputs = model.generate(
@@ -31,6 +31,7 @@ def paraphraseParaphraseMethod(requestValue : str):
31
  max_length=512,
32
  num_beams=5,
33
  length_penalty=0.8,
 
34
  early_stopping=True
35
  )
36
 
 
22
  for SENTENCE in tokenized_sent_list:
23
  text = "paraphrase: " + SENTENCE
24
 
25
+ encoding = tokenizer(text, return_tensors="pt", padding=longest, truncation=True)
26
  input_ids, attention_masks = encoding["input_ids"], encoding["attention_mask"]
27
 
28
  beam_outputs = model.generate(
 
31
  max_length=512,
32
  num_beams=5,
33
  length_penalty=0.8,
34
+ temperature=1.5,
35
  early_stopping=True
36
  )
37