Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ def initialize_clients():
|
|
| 20 |
print(f"Error initializing client: {str(e)}")
|
| 21 |
return None
|
| 22 |
|
| 23 |
-
if
|
| 24 |
CLIENT = initialize_clients()
|
| 25 |
|
| 26 |
STORY_GENRES = [
|
|
@@ -101,7 +101,7 @@ def story_generator_interface(prompt, genre, structure, model_choice, num_scenes
|
|
| 101 |
return error_msg, None
|
| 102 |
|
| 103 |
# Create Gradio interface
|
| 104 |
-
with gr.Blocks(
|
| 105 |
gr.Markdown("""
|
| 106 |
# ๐ญ AI Story Generator
|
| 107 |
Generate creative stories with AI and listen to them!
|
|
@@ -159,7 +159,6 @@ with gr.Blocks(title="AI Story Generator") as demo:
|
|
| 159 |
type="filepath"
|
| 160 |
)
|
| 161 |
|
| 162 |
-
# Fixed the click event outputs
|
| 163 |
generate_btn.click(
|
| 164 |
fn=story_generator_interface,
|
| 165 |
inputs=[
|
|
@@ -177,4 +176,10 @@ with gr.Blocks(title="AI Story Generator") as demo:
|
|
| 177 |
)
|
| 178 |
|
| 179 |
if __name__ == "__main__":
|
| 180 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
print(f"Error initializing client: {str(e)}")
|
| 21 |
return None
|
| 22 |
|
| 23 |
+
if "client" not in locals():
|
| 24 |
CLIENT = initialize_clients()
|
| 25 |
|
| 26 |
STORY_GENRES = [
|
|
|
|
| 101 |
return error_msg, None
|
| 102 |
|
| 103 |
# Create Gradio interface
|
| 104 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 105 |
gr.Markdown("""
|
| 106 |
# ๐ญ AI Story Generator
|
| 107 |
Generate creative stories with AI and listen to them!
|
|
|
|
| 159 |
type="filepath"
|
| 160 |
)
|
| 161 |
|
|
|
|
| 162 |
generate_btn.click(
|
| 163 |
fn=story_generator_interface,
|
| 164 |
inputs=[
|
|
|
|
| 176 |
)
|
| 177 |
|
| 178 |
if __name__ == "__main__":
|
| 179 |
+
demo.launch(
|
| 180 |
+
debug=True,
|
| 181 |
+
share=True,
|
| 182 |
+
server_name="0.0.0.0",
|
| 183 |
+
server_port=7860,
|
| 184 |
+
show_error=True
|
| 185 |
+
)
|