Spaces:
Runtime error
Runtime error
Commit
·
78cd1bd
1
Parent(s):
54f2f9f
ajuste device
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ def generate(images, prompt, processor, model, device, dtype, generation_config)
|
|
| 24 |
|
| 25 |
def main():
|
| 26 |
# step 1: Setup constant
|
| 27 |
-
device = "
|
| 28 |
dtype = torch.float16
|
| 29 |
|
| 30 |
# step 2: Load Processor and Model
|
|
|
|
| 24 |
|
| 25 |
def main():
|
| 26 |
# step 1: Setup constant
|
| 27 |
+
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
| 28 |
dtype = torch.float16
|
| 29 |
|
| 30 |
# step 2: Load Processor and Model
|