Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import spaces
|
|
3 |
|
4 |
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 |
|
@@ -24,8 +24,9 @@ def generate(model_name, image, text):
|
|
24 |
# model_pipe.to("cuda")
|
25 |
print("Generating!")
|
26 |
# with torch.autocast(device_type='cuda'):
|
27 |
-
|
28 |
-
|
|
|
29 |
|
30 |
iface = gr.Interface(
|
31 |
fn=generate, # function to call
|
|
|
3 |
|
4 |
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 |
|
|
|
24 |
# model_pipe.to("cuda")
|
25 |
print("Generating!")
|
26 |
# with torch.autocast(device_type='cuda'):
|
27 |
+
with torch.autocast(device_type='cuda', dtype=torch.float):
|
28 |
+
result = model_pipe(images=[image], texts=[text])
|
29 |
+
return result
|
30 |
|
31 |
iface = gr.Interface(
|
32 |
fn=generate, # function to call
|