Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ def generate_story(text):
|
|
14 |
prompt = PromptTemplate(
|
15 |
input_variables=["text"],
|
16 |
template="""
|
17 |
-
You are a fun and seasoned storyteller. Generate a story for
|
18 |
"""
|
19 |
)
|
20 |
story = LLMChain(llm=llm, prompt=prompt)
|
@@ -24,4 +24,12 @@ def app(text):
|
|
24 |
story = generate_story(text)
|
25 |
return story
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
prompt = PromptTemplate(
|
15 |
input_variables=["text"],
|
16 |
template="""
|
17 |
+
You are a fun and seasoned storyteller. Generate a short story for a 5 years old audience about {text}.
|
18 |
"""
|
19 |
)
|
20 |
story = LLMChain(llm=llm, prompt=prompt)
|
|
|
24 |
story = generate_story(text)
|
25 |
return story
|
26 |
|
27 |
+
with gr.Blocks() as demo:
|
28 |
+
with gr.Column():
|
29 |
+
text = gr.Textbox()
|
30 |
+
submit_btn = gr.Button('Submit')
|
31 |
+
story = gr.Textbox()
|
32 |
+
|
33 |
+
submit_btn.click(fn=app, inputs=[text], outputs=[story])
|
34 |
+
|
35 |
+
demo.launch()
|