yonigozlan HF staff commited on
Commit
b67fc39
·
1 Parent(s): 03cff7d

Compile model on gradio load

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -165,6 +165,8 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
165
  with gr.Row():
166
  submit = gr.Button(variant="primary")
167
 
 
 
168
  example = gr.Examples(
169
  examples=[
170
  ["./football.mp4", 0.3, 640],
@@ -182,5 +184,4 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
182
  )
183
 
184
  if __name__ == "__main__":
185
- init_compiled_model()
186
  demo.launch(show_error=True)
 
165
  with gr.Row():
166
  submit = gr.Button(variant="primary")
167
 
168
+ demo.load(init_compiled_model)
169
+
170
  example = gr.Examples(
171
  examples=[
172
  ["./football.mp4", 0.3, 640],
 
184
  )
185
 
186
  if __name__ == "__main__":
 
187
  demo.launch(show_error=True)