zhiqiulin commited on
Commit
39fbf51
·
verified ·
1 Parent(s): 2572bcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -5,10 +5,6 @@ import torch
5
  torch.jit.script = lambda f: f
6
  # torch.autocast = lambda device_type, dtype: torch.autocast(device_type, torch.float)
7
 
8
- from t2v_metrics import VQAScore, list_all_vqascore_models
9
-
10
- print(list_all_vqascore_models())
11
-
12
  # Initialize the model only once
13
  # if torch.cuda.is_available():
14
  # model_pipe = VQAScore(model="clip-flant5-xl", device="cpu") # our recommended scoring model
@@ -16,6 +12,11 @@ print("Model initialized!")
16
 
17
  @spaces.GPU
18
  def generate(model_name, image, text):
 
 
 
 
 
19
  # print("Model_name:", model_name)
20
  print("Image:", image)
21
  print("Text:", text)
 
5
  torch.jit.script = lambda f: f
6
  # torch.autocast = lambda device_type, dtype: torch.autocast(device_type, torch.float)
7
 
 
 
 
 
8
  # Initialize the model only once
9
  # if torch.cuda.is_available():
10
  # model_pipe = VQAScore(model="clip-flant5-xl", device="cpu") # our recommended scoring model
 
12
 
13
  @spaces.GPU
14
  def generate(model_name, image, text):
15
+
16
+ from t2v_metrics import VQAScore, list_all_vqascore_models
17
+
18
+ print(list_all_vqascore_models())
19
+
20
  # print("Model_name:", model_name)
21
  print("Image:", image)
22
  print("Text:", text)