Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -66,30 +66,25 @@ def text_to_speech(story):
|
|
66 |
return audio_file_path
|
67 |
|
68 |
demo = gr.Interface(
|
69 |
-
fn=
|
70 |
-
|
71 |
-
"
|
72 |
-
"
|
73 |
-
"
|
74 |
-
"
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
"Detect Objects": "text",
|
85 |
-
"Generate Story": "text",
|
86 |
-
"Summarize Story": "text",
|
87 |
-
"Generate Images": "image",
|
88 |
-
"Text to Speech": "audio"
|
89 |
-
},
|
90 |
title="AI-Powered Storytelling Assistant",
|
91 |
description="An AI assistant combining Object Detection, NLP, Image Generation, and TTS!"
|
92 |
)
|
|
|
93 |
|
94 |
if __name__ == "__main__":
|
95 |
demo.launch()
|
|
|
66 |
return audio_file_path
|
67 |
|
68 |
demo = gr.Interface(
|
69 |
+
fn=[detect_objects, generate_story, summarize_story, generate_images, text_to_speech],
|
70 |
+
inputs=[
|
71 |
+
gr.Image(type="numpy"), # Detect Objects
|
72 |
+
gr.Textbox(placeholder="Write a story prompt..."), # Generate Story
|
73 |
+
gr.Textbox(placeholder="Enter the generated story..."), # Summarize Story
|
74 |
+
gr.Textbox(placeholder="Enter the story for image generation..."), # Generate Images
|
75 |
+
gr.Textbox(placeholder="Enter text to convert to speech...") # Text to Speech
|
76 |
+
],
|
77 |
+
outputs=[
|
78 |
+
gr.Textbox(label="Detected Objects"),
|
79 |
+
gr.Textbox(label="Generated Story"),
|
80 |
+
gr.Textbox(label="Story Summary"),
|
81 |
+
gr.Image(label="Generated Images"),
|
82 |
+
gr.Audio(label="Generated Speech")
|
83 |
+
],
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
title="AI-Powered Storytelling Assistant",
|
85 |
description="An AI assistant combining Object Detection, NLP, Image Generation, and TTS!"
|
86 |
)
|
87 |
+
)
|
88 |
|
89 |
if __name__ == "__main__":
|
90 |
demo.launch()
|