Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,19 @@ import gradio as gr
|
|
3 |
|
4 |
import torch
|
5 |
|
|
|
|
|
|
|
|
|
6 |
first_generation = True
|
7 |
prefix = ''
|
8 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
9 |
|
10 |
model_checkpoint = "hackathon-pln-es/es_text_neutralizer"
|
|
|
11 |
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
|
|
13 |
|
14 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
|
15 |
# TODO: jarl!! check this for avoiding short segments
|
|
|
3 |
|
4 |
import torch
|
5 |
|
6 |
+
from datasets import load_dataset
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
first_generation = True
|
11 |
prefix = ''
|
12 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
13 |
|
14 |
model_checkpoint = "hackathon-pln-es/es_text_neutralizer"
|
15 |
+
data_checkpoint = "hackathon-pln-es/neutral-es"
|
16 |
|
17 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
18 |
+
dataset = load_dataset(data_checkpoint, split='test')
|
19 |
|
20 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)
|
21 |
# TODO: jarl!! check this for avoiding short segments
|