m-ric HF staff commited on
Commit
1212f91
β€’
1 Parent(s): 93a00aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -375,7 +375,7 @@ def generate_beams(start_sentence, scores, length_penalty, decoded_sequences):
375
  step == len(scores) - 1
376
  or current_token_choice_ix == tokenizer.eos_token_id
377
  ),
378
- is_selected_sequence=(current_sequence in decoded_sequences),
379
  )
380
 
381
  # Reassign all beams at once
@@ -465,7 +465,7 @@ This parameter will not impact the beam search paths, but only influence the cho
465
  label="Length penalty", minimum=-3, maximum=3, step=0.5, value=1
466
  )
467
  num_return_sequences = gr.Slider(
468
- label="Number of return sequences", minimum=1, maximum=4, step=1, value=3
469
  )
470
 
471
  n_beams.change(fn=change_num_return_sequences, inputs=n_beams, outputs=num_return_sequences)
 
375
  step == len(scores) - 1
376
  or current_token_choice_ix == tokenizer.eos_token_id
377
  ),
378
+ is_selected_sequence=(current_sequence.replace('<|endoftext|>', '') in [el.replace('<|endoftext|>', '') for el in decoded_sequences]),
379
  )
380
 
381
  # Reassign all beams at once
 
465
  label="Length penalty", minimum=-3, maximum=3, step=0.5, value=1
466
  )
467
  num_return_sequences = gr.Slider(
468
+ label="Number of return sequences", minimum=1, maximum=3, step=1, value=2
469
  )
470
 
471
  n_beams.change(fn=change_num_return_sequences, inputs=n_beams, outputs=num_return_sequences)