fffiloni commited on
Commit
3b9fcdd
1 Parent(s): 7402605

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -51,7 +51,7 @@ def generate_story(text):
51
  input_variables=["text"],
52
  template="""
53
  You are a fun and seasoned storyteller.
54
- Generate a short story for a 5 years old audience about {text}.
55
  Use short sentences. The story is not too long, but not too short either.
56
  Always finish your story with "The End".
57
  """
@@ -87,12 +87,16 @@ def app(text):
87
  story = generate_story(text)
88
  return story
89
 
90
- with gr.Blocks() as demo:
91
- with gr.Column():
92
- text = gr.Textbox()
 
 
 
 
93
  submit_btn = gr.Button('Submit')
94
- audio = gr.Audio()
95
- story = gr.Textbox()
96
 
97
  submit_btn.click(fn=app, inputs=[text], outputs=[story, audio])
98
 
 
51
  input_variables=["text"],
52
  template="""
53
  You are a fun and seasoned storyteller.
54
+ Generate a short bedtime story for a 5 years old audience about {text}.
55
  Use short sentences. The story is not too long, but not too short either.
56
  Always finish your story with "The End".
57
  """
 
87
  story = generate_story(text)
88
  return story
89
 
90
+ css = """
91
+ #col-container {max-width: 510px; margin-left: auto; margin-right: auto;}
92
+ a {text-decoration-line: underline; font-weight: 600;}
93
+ """
94
+ with gr.Blocks(css=css) as demo:
95
+ with gr.Column(elem_id="col-container"):
96
+ text = gr.Textbox(label="Subject", info="Will generate and tell a story about {your text input}")
97
  submit_btn = gr.Button('Submit')
98
+ audio = gr.Audio("The story audio told")
99
+ story = gr.Textbox(label="The story text")
100
 
101
  submit_btn.click(fn=app, inputs=[text], outputs=[story, audio])
102