Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from transformers import AutoTokenizer, ViTFeatureExtractor, VisionEncoderDecode
|
|
6 |
# Directory path to the saved model on Google Drive
|
7 |
model = VisionEncoderDecoderModel.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
8 |
feature_extractor = ViTFeatureExtractor.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained("nlpconnect/vit-gpt2-image-captioning
|
10 |
|
11 |
def generate_captions(image):
|
12 |
image = Image.open(image).convert("RGB")
|
|
|
6 |
# Directory path to the saved model on Google Drive
|
7 |
model = VisionEncoderDecoderModel.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
8 |
feature_extractor = ViTFeatureExtractor.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
10 |
|
11 |
def generate_captions(image):
|
12 |
image = Image.open(image).convert("RGB")
|