testdeep123 commited on
Commit
faa12ba
·
verified ·
1 Parent(s): 9577f14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
 
 
2
  from kokoro import KPipeline
3
 
4
  import soundfile as sf
@@ -2113,3 +2114,23 @@ with gr.Blocks() as demo:
2113
  }
2114
  """
2115
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+
3
  from kokoro import KPipeline
4
 
5
  import soundfile as sf
 
2114
  }
2115
  """
2116
  )
2117
+
2118
+ # Need to add an ID to the editing_area column in Python
2119
+ # Let's go back to the Python code and add `elem_id="editing_area_id"` to `gr.Column(visible=False) as editing_area:`
2120
+
2121
+
2122
+ # Launch the interface
2123
+ if __name__ == "__main__":
2124
+ # Attempt ImageMagick policy fix on script startup
2125
+ # This helps but might still require manual sudo depending on system config
2126
+ fix_imagemagick_policy()
2127
+
2128
+ print("Launching Gradio interface...")
2129
+
2130
+ # Check if API keys are still placeholders (unlikely with hardcoded keys, but good practice)
2131
+ if PEXELS_API_KEY.startswith('YOUR_PEXELS_API_KEY'):
2132
+ print("Warning: PEXELS_API_KEY is not configured. Media search may fail.")
2133
+ if OPENROUTER_API_KEY.startswith('YOUR_OPENROUTER_API_KEY'):
2134
+ print("Warning: OPENROUTER_API_KEY is not configured. Script generation will fail.")
2135
+
2136
+ demo.launch(share=True) # Set share=True to get a public link