perler commited on
Commit
f9d3dcc
1 Parent(s): b46e8b2

maybe timeout for gpu

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -3,16 +3,19 @@
3
  from __future__ import annotations
4
 
5
  import os
 
6
 
7
  import gradio as gr
8
  import spaces
9
 
10
 
11
- @spaces.GPU
12
  def run_on_gpu(input_shape, text, seed, guidance_scale):
 
13
  from model import Model
14
  model = Model()
15
  res_generator = model.run(shape_path=input_shape, text=text, seed=seed, guidance_scale=guidance_scale)
 
16
  return list(res_generator)
17
 
18
 
 
3
  from __future__ import annotations
4
 
5
  import os
6
+ import datetime
7
 
8
  import gradio as gr
9
  import spaces
10
 
11
 
12
+ @spaces.GPU(duration=60 * 10)
13
  def run_on_gpu(input_shape, text, seed, guidance_scale):
14
+ print('Starting inference at {}'.format(datetime.datetime.now()))
15
  from model import Model
16
  model = Model()
17
  res_generator = model.run(shape_path=input_shape, text=text, seed=seed, guidance_scale=guidance_scale)
18
+ print('Finished inference at {}'.format(datetime.datetime.now()))
19
  return list(res_generator)
20
 
21