Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,8 +17,8 @@ def generate_text(inp):
|
|
17 |
diverse_beams_output = model.generate(
|
18 |
input_ids=input_ids, attention_mask= attention_mask, max_length=256, early_stopping=True, num_beams=5, num_beam_groups=5, num_return_sequences=5, diversity_penalty=0.70)
|
19 |
|
20 |
-
|
21 |
-
|
22 |
|
23 |
output_text = gr.outputs.Textbox()
|
24 |
gr.Interface(generate_text, "textbox", output_text).launch(inline=False)
|
|
|
17 |
diverse_beams_output = model.generate(
|
18 |
input_ids=input_ids, attention_mask= attention_mask, max_length=256, early_stopping=True, num_beams=5, num_beam_groups=5, num_return_sequences=5, diversity_penalty=0.70)
|
19 |
|
20 |
+
sent = tokenizer.decode(diverse_beams_outputs[0], skip_special_tokens = True, clean_up_tokenization_spaces = True)
|
21 |
+
return sent
|
22 |
|
23 |
output_text = gr.outputs.Textbox()
|
24 |
gr.Interface(generate_text, "textbox", output_text).launch(inline=False)
|