Amitontheweb
commited on
Update app.py
Browse filesReverted to tokenizer with max length and truncation true.
app.py
CHANGED
@@ -15,7 +15,9 @@ def paraphrase(
|
|
15 |
):
|
16 |
input_ids = tokenizer(
|
17 |
f'paraphrase: {Content_to_Rephrase}',
|
18 |
-
return_tensors="pt", padding="longest"
|
|
|
|
|
19 |
).input_ids
|
20 |
|
21 |
outputs = model.generate(input_ids)
|
|
|
15 |
):
|
16 |
input_ids = tokenizer(
|
17 |
f'paraphrase: {Content_to_Rephrase}',
|
18 |
+
return_tensors="pt", padding="longest",
|
19 |
+
max_length=max_length,
|
20 |
+
truncation=True,
|
21 |
).input_ids
|
22 |
|
23 |
outputs = model.generate(input_ids)
|