Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
# Cargamos el modelo traductor y creamos el pipeline para traducir al ingles
|
5 |
-
spanish_model_name = "Helsinki-NLP/opus-mt-es-en"
|
6 |
-
translator_es_en = pipeline("translation", model=spanish_model_name)
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
english_text = translator_es_en(prompt_es)
|
11 |
-
prompt_en = english_text[0]['translation_text']
|
12 |
-
return prompt_en
|
13 |
-
|
14 |
-
title="Texto a Imagen en Español con Stable Diffusion 2.0"
|
15 |
article = """
|
16 |
El modelo usa:
|
17 |
- Texto a Imagen [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2),
|
18 |
-
- Para
|
19 |
\n ... y mucha magia ☺
|
20 |
"""
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
|
|
|
|
|
|
3 |
|
4 |
+
title="Texto a Imagen con Stable Diffusion 2.0"
|
5 |
+
description = '<h2 style="text-align:center">Prompt en Español!</h2>'
|
|
|
|
|
|
|
|
|
|
|
6 |
article = """
|
7 |
El modelo usa:
|
8 |
- Texto a Imagen [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2),
|
9 |
+
- Para la traduccion [Helsinki-NLP](https://huggingface.co/Helsinki-NLP)
|
10 |
\n ... y mucha magia ☺
|
11 |
"""
|
12 |
+
|
13 |
+
text_imagen = gr.Interface.load("models/stabilityai/stable-diffusion-2")
|
14 |
+
text_translate = gr.Interface.load("models/Helsinki-NLP/opus-mt-es-en")
|
15 |
+
|
16 |
+
gr.Series(text_translate, text_imagen, title=title, description = description, article=article).launch(debug=True)
|