Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -65,25 +65,15 @@ def text_to_speech(story):
|
|
65 |
tts.save(audio_file_path)
|
66 |
return audio_file_path
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
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 |
if __name__ == "__main__":
|
89 |
demo.launch()
|
|
|
65 |
tts.save(audio_file_path)
|
66 |
return audio_file_path
|
67 |
|
68 |
+
detect_interface = gr.Interface(fn=detect_objects, inputs="image", outputs="text", title="Object Detection")
|
69 |
+
story_interface = gr.Interface(fn=generate_story, inputs="text", outputs="text", title="Story Generation")
|
70 |
+
summary_interface = gr.Interface(fn=summarize_story, inputs="text", outputs="text", title="Story Summarization")
|
71 |
+
image_interface = gr.Interface(fn=generate_images, inputs="text", outputs="image", title="Image Generation")
|
72 |
+
audio_interface = gr.Interface(fn=text_to_speech, inputs="text", outputs="audio", title="Text to Speech")
|
73 |
+
|
74 |
+
# Συνδυασμός των interfaces σε ένα Gradio Tabbed Interface
|
75 |
+
demo = gr.TabbedInterface([detect_interface, story_interface, summary_interface, image_interface, audio_interface],
|
76 |
+
["Detect Objects", "Generate Story", "Summarize Story", "Generate Images", "Text to Speech"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
if __name__ == "__main__":
|
79 |
demo.launch()
|