Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def generate_text(inp):
|
|
| 15 |
input_ids, attention_mask = encoding["input_ids"].to(device), encoding["attention_mask"].to(device)
|
| 16 |
model.eval()
|
| 17 |
diverse_beams_output = model.generate(
|
| 18 |
-
input_ids
|
| 19 |
|
| 20 |
sent = tokenizer.decode(diverse_beams_outputs[0], skip_special_tokens = True, clean_up_tokenization_spaces = True)
|
| 21 |
return sent
|
|
|
|
| 15 |
input_ids, attention_mask = encoding["input_ids"].to(device), encoding["attention_mask"].to(device)
|
| 16 |
model.eval()
|
| 17 |
diverse_beams_output = model.generate(
|
| 18 |
+
input_ids=input_ids,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
|