Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,21 @@
|
|
1 |
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
tokenizer = AutoTokenizer.from_pretrained("SkolkovoInstitute/roberta_toxicity_classifier")
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
|
3 |
+
import gradio as gr
|
4 |
+
from gradio.mix import Series
|
|
|
5 |
|
6 |
+
description = "Reguetton spanish songs toxicity classification"
|
7 |
+
title = "ES-EN Translation / Toxicity classification / EN-ES Translation"
|
8 |
+
|
9 |
+
translator_es = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-es-en")
|
10 |
+
story_gen = gr.Interface.load("huggingface/SkolkovoInstitute/roberta_toxicity_classifier")
|
11 |
+
translator_en = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-es")
|
12 |
+
|
13 |
+
examples = [["La aventura comienza en"]]
|
14 |
+
|
15 |
+
interface = Series(translator_es, story_gen, translator_en, description = description,
|
16 |
+
title = title,
|
17 |
+
examples=examples,
|
18 |
+
inputs = gr.inputs.Textbox(lines = 10)
|
19 |
+
)
|
20 |
+
|
21 |
+
interface.launch()
|