Update app.py
Browse files
app.py
CHANGED
@@ -13,15 +13,12 @@ tokenizer = T5Tokenizer.from_pretrained("aditi2222/t5-paraphrase")
|
|
13 |
def tokenize_data(text):
|
14 |
# Tokenize the review body
|
15 |
input_ = "paraphrase: "+ str(text) + ' </s>'
|
16 |
-
|
17 |
max_len = 64
|
18 |
# tokenize inputs
|
19 |
tokenized_inputs = tokenizer(input_, padding='max_length', truncation=True, max_length=max_len, return_attention_mask=True, return_tensors='pt')
|
20 |
|
21 |
inputs={"input_ids": tokenized_inputs['input_ids'],
|
22 |
-
"attention_mask": tokenized_inputs['attention_mask']
|
23 |
-
}
|
24 |
-
|
25 |
return inputs
|
26 |
|
27 |
def generate_answers(text):
|
|
|
13 |
def tokenize_data(text):
|
14 |
# Tokenize the review body
|
15 |
input_ = "paraphrase: "+ str(text) + ' </s>'
|
|
|
16 |
max_len = 64
|
17 |
# tokenize inputs
|
18 |
tokenized_inputs = tokenizer(input_, padding='max_length', truncation=True, max_length=max_len, return_attention_mask=True, return_tensors='pt')
|
19 |
|
20 |
inputs={"input_ids": tokenized_inputs['input_ids'],
|
21 |
+
"attention_mask": tokenized_inputs['attention_mask']}
|
|
|
|
|
22 |
return inputs
|
23 |
|
24 |
def generate_answers(text):
|