Update paraphrase.py
Browse files- paraphrase.py +4 -4
paraphrase.py
CHANGED
@@ -2,12 +2,12 @@ import re
|
|
2 |
import torch
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def para(paragraph):
|
7 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("ramsrigouthamg/t5-large-paraphraser-diverse-high-quality")
|
8 |
-
tokenizer = AutoTokenizer.from_pretrained("ramsrigouthamg/t5-large-paraphraser-diverse-high-quality")
|
9 |
-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
10 |
-
model = model.to(device)
|
11 |
|
12 |
sen = []
|
13 |
for i in paragraph:
|
|
|
2 |
import torch
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
|
5 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("ramsrigouthamg/t5-large-paraphraser-diverse-high-quality")
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained("ramsrigouthamg/t5-large-paraphraser-diverse-high-quality")
|
7 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
8 |
+
model = model.to(device)
|
9 |
|
10 |
def para(paragraph):
|
|
|
|
|
|
|
|
|
11 |
|
12 |
sen = []
|
13 |
for i in paragraph:
|