tokenizer 512 max length
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
|
|
5 |
|
6 |
def simplify(text):
|
7 |
model= T5ForConditionalGeneration.from_pretrained("mynti/plainly-v1")
|
8 |
-
tokenizer = T5Tokenizer.from_pretrained('t5-base')
|
9 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
10 |
model = model.to(device)
|
11 |
preprocess_text = "simplify: " + text.strip()
|
|
|
5 |
|
6 |
def simplify(text):
|
7 |
model= T5ForConditionalGeneration.from_pretrained("mynti/plainly-v1")
|
8 |
+
tokenizer = T5Tokenizer.from_pretrained('t5-base', model_max_length=512)
|
9 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
10 |
model = model.to(device)
|
11 |
preprocess_text = "simplify: " + text.strip()
|