akhaliq HF Staff commited on
Commit
2a343c0
·
verified ·
1 Parent(s): 5f47e36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -185,7 +185,7 @@ def create_ui():
185
  fn=generate_with_auth,
186
  inputs=[prompt_input],
187
  outputs=[video_output, status_output],
188
- queue=False
189
  )
190
 
191
  # Image -> Video UI
@@ -212,13 +212,12 @@ def create_ui():
212
  fn=generate_with_auth_image,
213
  inputs=[img_prompt_input, image_input],
214
  outputs=[video_output_img, status_output_img],
215
- queue=False
216
  )
217
 
218
  # Example usage guidance
219
  gr.Examples(
220
  examples=[
221
- "A majestic golden eagle soaring through a vibrant sunset sky"
222
  ],
223
  inputs=prompt_input,
224
  outputs=video_output,
@@ -239,11 +238,16 @@ if __name__ == "__main__":
239
  print(f"Initial cleanup error: {e}")
240
 
241
  app = create_ui()
242
- # Launch without special auth parameters
243
- # OAuth is enabled via Space metadata (hf_oauth: true in README.md)
 
 
 
 
 
244
  app.launch(
245
  show_api=False,
246
  enable_monitoring=False,
247
  quiet=True,
248
- max_threads=10
249
  )
 
185
  fn=generate_with_auth,
186
  inputs=[prompt_input],
187
  outputs=[video_output, status_output],
188
+ # Queue will be automatically enabled with OAuth
189
  )
190
 
191
  # Image -> Video UI
 
212
  fn=generate_with_auth_image,
213
  inputs=[img_prompt_input, image_input],
214
  outputs=[video_output_img, status_output_img],
 
215
  )
216
 
217
  # Example usage guidance
218
  gr.Examples(
219
  examples=[
220
+ ["A majestic golden eagle soaring through a vibrant sunset sky"],
221
  ],
222
  inputs=prompt_input,
223
  outputs=video_output,
 
238
  print(f"Initial cleanup error: {e}")
239
 
240
  app = create_ui()
241
+ # Configure queue with optimized settings for OAuth-enabled app
242
+ app.queue(
243
+ status_update_rate="auto",
244
+ api_open=False, # Disable public API access for security
245
+ max_size=50, # Reasonable queue size
246
+ default_concurrency_limit=10 # Allow multiple concurrent requests
247
+ )
248
  app.launch(
249
  show_api=False,
250
  enable_monitoring=False,
251
  quiet=True,
252
+ max_threads=40, # Increase thread pool for better performance
253
  )