Spaces:
Sleeping
Sleeping
Prakhar Trivedi
commited on
Commit
·
e1a9146
1
Parent(s):
2713ac2
fixed broken repo id reference
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ EMBED_DIM = 256
|
|
| 12 |
HIDDEN_DIM = 512
|
| 13 |
MAX_SEQ_LENGTH = 25
|
| 14 |
VOCAB_SIZE = 8492
|
| 15 |
-
DEVICE = torch.device("cpu")
|
| 16 |
|
| 17 |
transform_inference = transforms.Compose([
|
| 18 |
transforms.Resize((384, 384)),
|
|
@@ -151,7 +151,7 @@ def load_model_and_vocab(repo_id):
|
|
| 151 |
|
| 152 |
return model, vocab
|
| 153 |
|
| 154 |
-
model, vocab = load_model_and_vocab("prakhartrivedi/
|
| 155 |
print("Model and vocabulary loaded successfully.")
|
| 156 |
|
| 157 |
def generate_caption_for_image(img):
|
|
|
|
| 12 |
HIDDEN_DIM = 512
|
| 13 |
MAX_SEQ_LENGTH = 25
|
| 14 |
VOCAB_SIZE = 8492
|
| 15 |
+
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 16 |
|
| 17 |
transform_inference = transforms.Compose([
|
| 18 |
transforms.Resize((384, 384)),
|
|
|
|
| 151 |
|
| 152 |
return model, vocab
|
| 153 |
|
| 154 |
+
model, vocab = load_model_and_vocab("prakhartrivedi/ImageCaptioningSCCCI")
|
| 155 |
print("Model and vocabulary loaded successfully.")
|
| 156 |
|
| 157 |
def generate_caption_for_image(img):
|