NoaiGPT commited on
Commit
5096125
1 Parent(s): cbec9d4
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -230,31 +230,31 @@ def generate_paraphrases(text, setting, output_format):
230
  num_return_sequences = 3
231
  repetition_penalty = 1.1
232
  no_repeat_ngram_size = 2
233
- temperature = 1.0
234
  max_length = 128
235
  elif setting == 2:
236
  num_return_sequences = 3
237
  repetition_penalty = 1.2
238
  no_repeat_ngram_size = 3
239
- temperature = 1.2
240
  max_length = 192
241
  elif setting == 3:
242
  num_return_sequences = 3
243
  repetition_penalty = 1.3
244
  no_repeat_ngram_size = 4
245
- temperature = 1.4
246
  max_length = 256
247
  elif setting == 4:
248
  num_return_sequences = 3
249
  repetition_penalty = 1.4
250
  no_repeat_ngram_size = 5
251
- temperature = 1.6
252
  max_length = 320
253
  else:
254
  num_return_sequences = 3
255
  repetition_penalty = 1.5
256
  no_repeat_ngram_size = 6
257
- temperature = 1.8
258
  max_length = 384
259
 
260
  top_k = 50
@@ -274,12 +274,13 @@ def generate_paraphrases(text, setting, output_format):
274
  for i, sentence in enumerate(sentences):
275
  paraphrases = paraphrase_pipeline(
276
  sentence,
277
- num_beams=3,
278
- num_beam_groups=3,
279
  num_return_sequences=num_return_sequences,
280
- diversity_penalty=2.0,
281
  no_repeat_ngram_size=no_repeat_ngram_size,
282
  repetition_penalty=repetition_penalty,
 
283
  max_length=max_length
284
  )
285
 
 
230
  num_return_sequences = 3
231
  repetition_penalty = 1.1
232
  no_repeat_ngram_size = 2
233
+ temperature = 0.9
234
  max_length = 128
235
  elif setting == 2:
236
  num_return_sequences = 3
237
  repetition_penalty = 1.2
238
  no_repeat_ngram_size = 3
239
+ temperature = 0.95
240
  max_length = 192
241
  elif setting == 3:
242
  num_return_sequences = 3
243
  repetition_penalty = 1.3
244
  no_repeat_ngram_size = 4
245
+ temperature = 1.0
246
  max_length = 256
247
  elif setting == 4:
248
  num_return_sequences = 3
249
  repetition_penalty = 1.4
250
  no_repeat_ngram_size = 5
251
+ temperature = 1.05
252
  max_length = 320
253
  else:
254
  num_return_sequences = 3
255
  repetition_penalty = 1.5
256
  no_repeat_ngram_size = 6
257
+ temperature = 1.1
258
  max_length = 384
259
 
260
  top_k = 50
 
274
  for i, sentence in enumerate(sentences):
275
  paraphrases = paraphrase_pipeline(
276
  sentence,
277
+ num_beams=5,
278
+ num_beam_groups=1,
279
  num_return_sequences=num_return_sequences,
280
+ diversity_penalty=1.0,
281
  no_repeat_ngram_size=no_repeat_ngram_size,
282
  repetition_penalty=repetition_penalty,
283
+ temperature=temperature,
284
  max_length=max_length
285
  )
286