Update paraphrase.py
Browse files- paraphrase.py +3 -1
paraphrase.py
CHANGED
@@ -3,12 +3,14 @@ import torch
|
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
import streamlit as st
|
5 |
|
6 |
-
|
|
|
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 |
def para(paragraph):
|
13 |
|
14 |
sen = []
|
|
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
import streamlit as st
|
5 |
|
6 |
+
|
7 |
+
|
8 |
model = AutoModelForSeq2SeqLM.from_pretrained("ramsrigouthamg/t5-large-paraphraser-diverse-high-quality")
|
9 |
tokenizer = AutoTokenizer.from_pretrained("ramsrigouthamg/t5-large-paraphraser-diverse-high-quality")
|
10 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
11 |
model = model.to(device)
|
12 |
|
13 |
+
@st.cache(allow_output_mutation=True)
|
14 |
def para(paragraph):
|
15 |
|
16 |
sen = []
|