Spaces:
Runtime error
Runtime error
Commit
•
ecda335
1
Parent(s):
58572c5
Update app.py
Browse files
app.py
CHANGED
@@ -33,11 +33,11 @@ device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
33 |
model = VisionEncoderDecoderModel.from_pretrained(model_path)
|
34 |
model.to(device)
|
35 |
print("Loaded model")
|
36 |
-
feature_extractor = AutoFeatureExtractor.from_pretrained(
|
37 |
print("Loaded feature_extractor")
|
38 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
39 |
-
if model.decoder.name_or_path == "gpt2":
|
40 |
-
|
41 |
print("Loaded tokenizer")
|
42 |
title = "Hindi Image Captioning"
|
43 |
description = ""
|
|
|
33 |
model = VisionEncoderDecoderModel.from_pretrained(model_path)
|
34 |
model.to(device)
|
35 |
print("Loaded model")
|
36 |
+
feature_extractor = AutoFeatureExtractor.from_pretrained("google/vit-base-patch16-224-in21k")
|
37 |
print("Loaded feature_extractor")
|
38 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
39 |
+
#if model.decoder.name_or_path == "gpt2":
|
40 |
+
# tokenizer.pad_token = tokenizer.bos_token
|
41 |
print("Loaded tokenizer")
|
42 |
title = "Hindi Image Captioning"
|
43 |
description = ""
|