Deep1994 commited on
Commit
40ab9ce
·
1 Parent(s): d8aa481

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -44,7 +44,7 @@ if text != '':
44
  top_k=50,
45
  top_p=0.95,
46
  early_stopping=True,
47
- num_return_sequences=5
48
  )
49
  elif str(decoding_strategy) == 'Beam Search':
50
  beam_outputs = model.generate(
@@ -53,7 +53,7 @@ if text != '':
53
  max_length=20,
54
  num_beams=5,
55
  no_repeat_ngram_size=2,
56
- num_return_sequences=5,
57
  early_stopping=True
58
  )
59
 
@@ -62,6 +62,8 @@ if text != '':
62
  sent = tokenizer.decode(beam_output, skip_special_tokens=True, clean_up_tokenization_spaces=True)
63
  if sent.lower() != text.lower() and sent not in final_outputs:
64
  final_outputs.append(sent)
 
 
65
  # final_outputs.append(sent)
66
 
67
  st.subheader('Paraphrased Text')
 
44
  top_k=50,
45
  top_p=0.95,
46
  early_stopping=True,
47
+ num_return_sequences=10
48
  )
49
  elif str(decoding_strategy) == 'Beam Search':
50
  beam_outputs = model.generate(
 
53
  max_length=20,
54
  num_beams=5,
55
  no_repeat_ngram_size=2,
56
+ num_return_sequences=10,
57
  early_stopping=True
58
  )
59
 
 
62
  sent = tokenizer.decode(beam_output, skip_special_tokens=True, clean_up_tokenization_spaces=True)
63
  if sent.lower() != text.lower() and sent not in final_outputs:
64
  final_outputs.append(sent)
65
+ if len(final_outputs) == 5:
66
+ break
67
  # final_outputs.append(sent)
68
 
69
  st.subheader('Paraphrased Text')