Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ tokenizer = AutoTokenizer.from_pretrained("model")
|
|
| 44 |
|
| 45 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 46 |
|
| 47 |
-
|
| 48 |
|
| 49 |
def generate_caption(processor, model, image, tokenizer=None):
|
| 50 |
# max_length = 16
|
|
|
|
| 44 |
|
| 45 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 46 |
|
| 47 |
+
cap_model.to(device)
|
| 48 |
|
| 49 |
def generate_caption(processor, model, image, tokenizer=None):
|
| 50 |
# max_length = 16
|