File size: 632 Bytes
44c9aae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from gradio.mix import Series

description = "Generate your own D&D story!"
title = "Spanish Story Generator using Opus MT and GPT-2"

translator_es = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-es-en")
story_gen = gr.Interface.load("huggingface/pranavpsv/gpt2-genre-story-generator")
translator_en = gr.Interface.load("huggingface/Helsinki-NLP/opus-mt-en-es")

examples = [["La aventura comienza en"]]

interface = Series(translator_es, story_gen, translator_en, description = description,
      title = title,
      examples=examples, 
      inputs = gr.inputs.Textbox(lines = 10)
)

interface.launch()