shaheerawan3 commited on
Commit
fc46f06
·
verified ·
1 Parent(s): 1b5ca07

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -527,7 +527,13 @@ class EnhancedVideoGenerator:
527
  except Exception as e:
528
  logging.error(f"Initialization failed: {str(e)}")
529
  raise RuntimeError("Failed to initialize video generator")
530
-
 
 
 
 
 
 
531
  def generate_video(script):
532
  st.progress(0)
533
  try:
 
527
  except Exception as e:
528
  logging.error(f"Initialization failed: {str(e)}")
529
  raise RuntimeError("Failed to initialize video generator")
530
+
531
+ def generate_video_in_background(script):
532
+ with ThreadPoolExecutor() as executor:
533
+ future = executor.submit(generate_video, script)
534
+ return future.result() # Wait for the result without blocking UI
535
+
536
+
537
  def generate_video(script):
538
  st.progress(0)
539
  try: