zhiqiulin commited on
Commit
b63cc04
·
verified ·
1 Parent(s): a3da00a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,13 +5,13 @@ torch.jit.script = lambda f: f # Avoid script error in lambda
5
 
6
  from t2v_metrics import VQAScore, list_all_vqascore_models
7
 
 
 
 
8
  # Global model variable, but do not initialize or move to CUDA here
9
  cur_model_name = "clip-flant5-xl"
10
  model_pipe = update_model(cur_model_name)
11
 
12
- def update_model(model_name):
13
- return VQAScore(model=model_name, device="cuda")
14
-
15
  @spaces.GPU(duration = 20)
16
  def generate(model_name, image, text):
17
  if model_name != cur_model_name:
 
5
 
6
  from t2v_metrics import VQAScore, list_all_vqascore_models
7
 
8
+ def update_model(model_name):
9
+ return VQAScore(model=model_name, device="cuda")
10
+
11
  # Global model variable, but do not initialize or move to CUDA here
12
  cur_model_name = "clip-flant5-xl"
13
  model_pipe = update_model(cur_model_name)
14
 
 
 
 
15
  @spaces.GPU(duration = 20)
16
  def generate(model_name, image, text):
17
  if model_name != cur_model_name: