Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def generate_text(inp):
|
|
12 |
text = "paraphrase: "+context + " </s>"
|
13 |
context = inp
|
14 |
encoding = tokenizer.encode_plus(text, max_length=256, padding=True, return_tensors="pt")
|
15 |
-
input_ids, attention_mask = encoding["input_ids"].to(device), encoding["attention_mask"].to(
|
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)
|
|
|
12 |
text = "paraphrase: "+context + " </s>"
|
13 |
context = inp
|
14 |
encoding = tokenizer.encode_plus(text, max_length=256, padding=True, return_tensors="pt")
|
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)
|