Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,9 @@ def generate(model_name, image, text):
|
|
23 |
# print("Model initialized, now moving to cuda")
|
24 |
# model_pipe.to("cuda")
|
25 |
print("Generating!")
|
26 |
-
|
|
|
|
|
27 |
|
28 |
iface = gr.Interface(
|
29 |
fn=generate, # function to call
|
|
|
23 |
# print("Model initialized, now moving to cuda")
|
24 |
# model_pipe.to("cuda")
|
25 |
print("Generating!")
|
26 |
+
with torch.autocast(device_type='cuda', dtype=torch.bfloat16):
|
27 |
+
result = model_pipe(images=[image_tensor], texts=[text])
|
28 |
+
return result
|
29 |
|
30 |
iface = gr.Interface(
|
31 |
fn=generate, # function to call
|