Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,6 @@ def generate_story(text, lang):
|
|
54 |
Generate a short bedtime story for a 5 years old audience about {text}.
|
55 |
Your story must be written in {lang}.
|
56 |
Use short sentences. The story is not too long, but not too short either.
|
57 |
-
Always finish your story with "The End".
|
58 |
"""
|
59 |
)
|
60 |
story = LLMChain(llm=llm, prompt=prompt)
|
@@ -111,11 +110,15 @@ with gr.Blocks(css=css) as demo:
|
|
111 |
Generate a bedtime story for a 5 years old audience who needs to get some sleep π΄
|
112 |
</p>
|
113 |
</div>""")
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
119 |
|
120 |
submit_btn.click(fn=app, inputs=[text, lang], outputs=[story, audio])
|
121 |
|
|
|
54 |
Generate a short bedtime story for a 5 years old audience about {text}.
|
55 |
Your story must be written in {lang}.
|
56 |
Use short sentences. The story is not too long, but not too short either.
|
|
|
57 |
"""
|
58 |
)
|
59 |
story = LLMChain(llm=llm, prompt=prompt)
|
|
|
110 |
Generate a bedtime story for a 5 years old audience who needs to get some sleep π΄
|
111 |
</p>
|
112 |
</div>""")
|
113 |
+
with gr.Group():
|
114 |
+
with gr.Column():
|
115 |
+
text = gr.Textbox(label="Subject: what the story should be about ?", info="Will generate and tell a story about {your text input}")
|
116 |
+
lang = gr.Dropdown(label="Pick a language", choices=["English", "French", "German", "Hindi", "Italian", "Polish", "Portuguese", "Spanish"], value="English")
|
117 |
+
submit_btn = gr.Button('Submit')
|
118 |
+
with gr.Group():
|
119 |
+
with gr.Column():
|
120 |
+
audio = gr.Audio(label="The story audio told")
|
121 |
+
story = gr.Textbox(label="The story text")
|
122 |
|
123 |
submit_btn.click(fn=app, inputs=[text, lang], outputs=[story, audio])
|
124 |
|