awacke1 commited on
Commit
5503f03
ยท
verified ยท
1 Parent(s): ba9176f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -20,7 +20,7 @@ def initialize_clients():
20
  print(f"Error initializing client: {str(e)}")
21
  return None
22
 
23
- if gr.NO_RELOAD:
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(title="AI Story Generator") as demo:
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(reload=True)
 
 
 
 
 
 
 
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
+ )