Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files430 unmodified lines4314324334344354363 unmodified lines440441442443444445446447430 unmodified linesreturn_dict_in_generate=True,length_penalty=length_penalty,output_scores=True,do_sample=False,)markdown = "The conclusive sequences are the ones that end in an `<|endoftext|>` token or at the end of generation."3 unmodified linesmarkdown += "\n#### <span style='color:var(--secondary-500)!important'>Output sequences:</span>"# Sequences are padded anyway so you can batch decode themdecoded_sequences = tokenizer.batch_decode(outputs.sequences)for i, sequence in enumerate(decoded_sequences):markdown += f"\n- Score `{outputs.sequences_scores[i]:.2f}`: `{clean(sequence.replace('<s> ', ''))}`"if number_beams > 1:original_tree = generate_beams(430 unmodified lines4314324334344354364373 unmodified lines441442443444445446447448449450430 unmodified linesreturn_dict_in_generate=True,length_penalty=length_penalty,output_scores=True,output_logits=True,do_sample=False,)markdown = "The conclusive sequences are the ones that end in an `<|endoftext|>` token or at the end of generation."3 unmodified linesmarkdown += "\n#### <span style='color:var(--secondary-500)!important'>Output sequences:</span>"# Sequences are padded anyway so you can batch decode themdecoded_sequences = tokenizer.batch_decode(outputs.sequences)sequence_scores = (outputs.sequences_scores is n_beams > 1 else outputs.scores)for i, sequence in enumerate(decoded_sequences):markdown += f"\n- Score `{sequence_scores[i]:.2f}`: `{clean(sequence.replace('<s> ', ''))}`"if number_beams > 1:original_tree = generate_beams(
app.py+4-1