Spaces:
Sleeping
Sleeping
SOS error again
Browse files
app/image_captioning_service.py
CHANGED
|
@@ -301,7 +301,7 @@ class ImageCaptioningModel(torch.nn.Module):
|
|
| 301 |
img_features = img_features.unsqueeze(1)
|
| 302 |
|
| 303 |
# Start with < SOS > token
|
| 304 |
-
current_ids = torch.tensor([[vocab.word2idx['<
|
| 305 |
|
| 306 |
# Generate words one by one
|
| 307 |
result_caption = []
|
|
|
|
| 301 |
img_features = img_features.unsqueeze(1)
|
| 302 |
|
| 303 |
# Start with < SOS > token
|
| 304 |
+
current_ids = torch.tensor([[vocab.word2idx['<SOS>']]], dtype=torch.long).to(image.device)
|
| 305 |
|
| 306 |
# Generate words one by one
|
| 307 |
result_caption = []
|