Spaces:
Sleeping
Sleeping
SOS error resolve
Browse files
app/image_captioning_service.py
CHANGED
|
@@ -295,7 +295,7 @@ class ImageCaptioningModel(torch.nn.Module):
|
|
| 295 |
img_features = img_features.unsqueeze(1)
|
| 296 |
|
| 297 |
# Start with < SOS > token
|
| 298 |
-
current_ids = torch.tensor([[vocab.word2idx['<
|
| 299 |
|
| 300 |
# Generate words one by one
|
| 301 |
result_caption = []
|
|
|
|
| 295 |
img_features = img_features.unsqueeze(1)
|
| 296 |
|
| 297 |
# Start with < SOS > token
|
| 298 |
+
current_ids = torch.tensor([[vocab.word2idx['<SOS>']]], dtype=torch.long).to(image.device)
|
| 299 |
|
| 300 |
# Generate words one by one
|
| 301 |
result_caption = []
|