Update paraphrase.py
Browse files- paraphrase.py +2 -0
paraphrase.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
import re
|
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")
|
|
|
1 |
import re
|
2 |
import torch
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
+
import streamlit as st
|
5 |
|
6 |
+
@st.cache(allow_output_mutation=True)
|
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")
|