Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,6 @@ print(list_all_vqascore_models())
|
|
11 |
# Initialize the model only once
|
12 |
if torch.cuda.is_available():
|
13 |
model_pipe = VQAScore(model="clip-flant5-xl") # our recommended scoring model
|
14 |
-
model_pipe.to("cuda")
|
15 |
print("Model initialized!")
|
16 |
|
17 |
@spaces.GPU
|
@@ -19,6 +18,7 @@ def generate(model_name, image, text):
|
|
19 |
# print("Model_name:", model_name)
|
20 |
print("Image:", image)
|
21 |
print("Text:", text)
|
|
|
22 |
return model_pipe(images=[image], texts=[text])
|
23 |
|
24 |
iface = gr.Interface(
|
|
|
11 |
# Initialize the model only once
|
12 |
if torch.cuda.is_available():
|
13 |
model_pipe = VQAScore(model="clip-flant5-xl") # our recommended scoring model
|
|
|
14 |
print("Model initialized!")
|
15 |
|
16 |
@spaces.GPU
|
|
|
18 |
# print("Model_name:", model_name)
|
19 |
print("Image:", image)
|
20 |
print("Text:", text)
|
21 |
+
model_pipe.to("cuda")
|
22 |
return model_pipe(images=[image], texts=[text])
|
23 |
|
24 |
iface = gr.Interface(
|