sk61tc4j53obiq commited on
Commit
dd8c364
·
verified ·
1 Parent(s): d9b71e7

Fix zero gpu renting duration

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -31,6 +31,8 @@ from transformers import WhisperModel
31
 
32
  import spaces
33
 
 
 
34
  if os.getenv('SYSTEM') == 'spaces':
35
  subprocess.run(["bash", "install.sh"])
36
 
@@ -188,7 +190,7 @@ def fast_check_ffmpeg():
188
  return False
189
 
190
 
191
- @spaces.GPU()
192
  @torch.no_grad()
193
  def inference(audio_path, video_path, bbox_shift, extra_margin=10, parsing_mode="jaw",
194
  left_cheek_width=90, right_cheek_width=90, progress=gr.Progress(track_tqdm=True)):
 
31
 
32
  import spaces
33
 
34
+ SPACES_MAX_DURATION = 25 * 60 # 25 minutes
35
+
36
  if os.getenv('SYSTEM') == 'spaces':
37
  subprocess.run(["bash", "install.sh"])
38
 
 
190
  return False
191
 
192
 
193
+ @spaces.GPU(SPACES_MAX_DURATION)
194
  @torch.no_grad()
195
  def inference(audio_path, video_path, bbox_shift, extra_margin=10, parsing_mode="jaw",
196
  left_cheek_width=90, right_cheek_width=90, progress=gr.Progress(track_tqdm=True)):