Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def create_story(noun1, adjective1, verb1, noun2, adjective2, verb2):
|
| 4 |
+
story = (f"One day, a {adjective1} {noun1} {verb1} through the forest. "
|
| 5 |
+
f"It came across a {adjective2} {noun2} and they quickly became friends. "
|
| 6 |
+
f"Later, they both {verb2} happily ever after.")
|
| 7 |
+
return story
|
| 8 |
+
|
| 9 |
+
iface = gr.Interface(
|
| 10 |
+
fn=create_story,
|
| 11 |
+
inputs=[
|
| 12 |
+
gr.inputs.Textbox(label="Enter a noun"),
|
| 13 |
+
gr.inputs.Textbox(label="Enter an adjective"),
|
| 14 |
+
gr.inputs.Textbox(label="Enter a verb (past tense)"),
|
| 15 |
+
gr.inputs.Textbox(label="Enter another noun"),
|
| 16 |
+
gr.inputs.Textbox(label="Enter another adjective"),
|
| 17 |
+
gr.inputs.Textbox(label="Enter another verb (past tense)")
|
| 18 |
+
],
|
| 19 |
+
outputs="text",
|
| 20 |
+
live=True
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
iface.launch()
|