tournas commited on
Commit
3e59dae
·
verified ·
1 Parent(s): 6c16c02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -21
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
- "Detect Objects": detect_objects,
71
- "Generate Story": generate_story,
72
- "Summarize Story": summarize_story,
73
- "Generate Images": generate_images,
74
- "Text to Speech": text_to_speech,
75
- },
76
- inputs={
77
- "Detect Objects": gr.Image(type="numpy"),
78
- "Generate Story": gr.Textbox(placeholder="Write a story prompt..."),
79
- "Summarize Story": gr.Textbox(placeholder="Enter the generated story..."),
80
- "Generate Images": gr.Textbox(placeholder="Enter the story for image generation..."),
81
- "Text to Speech": gr.Textbox(placeholder="Enter text to convert to speech...")
82
- },
83
- outputs={
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()