Amitontheweb commited on
Commit
427c414
·
verified ·
1 Parent(s): 981ed00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -13,6 +13,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained("humarin/chatgpt_paraphraser_on_T5
13
  def paraphrase(
14
  Content_to_Rephrase,
15
  num_return_sequences=3,
 
16
  ):
17
  input_ids = tokenizer(
18
  f'paraphrase: {Content_to_Rephrase}',
@@ -21,7 +22,7 @@ def paraphrase(
21
  truncation=True,
22
  ).input_ids
23
 
24
- outputs = model.generate(input_ids, num_return_sequences=num_return_sequences)
25
 
26
  res = tokenizer.batch_decode(outputs, skip_special_tokens=True)
27
  res1 = res [0]
 
13
  def paraphrase(
14
  Content_to_Rephrase,
15
  num_return_sequences=3,
16
+ num_beams: 10
17
  ):
18
  input_ids = tokenizer(
19
  f'paraphrase: {Content_to_Rephrase}',
 
22
  truncation=True,
23
  ).input_ids
24
 
25
+ outputs = model.generate(input_ids, num_beams=num_beams, num_return_sequences=num_return_sequences)
26
 
27
  res = tokenizer.batch_decode(outputs, skip_special_tokens=True)
28
  res1 = res [0]