Spaces:
Runtime error
Runtime error
Omar Sanseviero
commited on
Commit
·
44c9aae
1
Parent(s):
2c92c9b
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from gradio.mix import Series
|
| 3 |
+
|
| 4 |
+
description = "Generate your own D&D story!"
|
| 5 |
+
title = "Spanish Story Generator using Opus MT and GPT-2"
|
| 6 |
+
|
| 7 |
+
translator_es = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-es-en")
|
| 8 |
+
story_gen = gr.Interface.load("huggingface/pranavpsv/gpt2-genre-story-generator")
|
| 9 |
+
translator_en = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-es")
|
| 10 |
+
|
| 11 |
+
examples = [["La aventura comienza en"]]
|
| 12 |
+
|
| 13 |
+
interface = Series(translator_es, story_gen, translator_en, description = description,
|
| 14 |
+
title = title,
|
| 15 |
+
examples=examples,
|
| 16 |
+
inputs = gr.inputs.Textbox(lines = 10)
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
interface.launch()
|