Amitontheweb commited on
Commit
d19b7e2
·
verified ·
1 Parent(s): d2a2e84

Update app.py

Browse files

Reverted to tokenizer with max length and truncation true.

Files changed (1) hide show
  1. app.py +3 -1
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)