ghostsInTheMachine commited on
Commit
2f18b37
1 Parent(s): 8bc85a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -166,6 +166,8 @@ def process_wrapper(video, fps=0, seed=0):
166
  raise gr.Error("Please upload a video.")
167
  try:
168
  outputs = []
 
 
169
  # Use video directly, since it's the file path
170
  for output in process_video(video, fps, seed):
171
  outputs.append(output)
@@ -173,7 +175,7 @@ def process_wrapper(video, fps=0, seed=0):
173
  return outputs[-1]
174
  except Exception as e:
175
  raise gr.Error(f"Error processing video: {str(e)}")
176
-
177
  # Custom CSS for styling (unchanged)
178
  custom_css = """
179
  .title-container {
 
166
  raise gr.Error("Please upload a video.")
167
  try:
168
  outputs = []
169
+ # Initialize models within the Gradio request context
170
+ initialize_models()
171
  # Use video directly, since it's the file path
172
  for output in process_video(video, fps, seed):
173
  outputs.append(output)
 
175
  return outputs[-1]
176
  except Exception as e:
177
  raise gr.Error(f"Error processing video: {str(e)}")
178
+
179
  # Custom CSS for styling (unchanged)
180
  custom_css = """
181
  .title-container {