Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import VisionEncoderDecoderModel, ViTImageProcessor, GPT2Tokenizer
|
3 |
import torch
|
4 |
from PIL import Image
|
5 |
|
6 |
# Load the model and tokenizer
|
7 |
model = VisionEncoderDecoderModel.from_pretrained("ashok2216/vit-gpt2-image-captioning_COCO_FineTuned")
|
8 |
-
processor = ViTImageProcessor.from_pretrained("ashok2216/vit-gpt2-image-captioning_COCO_FineTuned")
|
|
|
9 |
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
|
10 |
|
11 |
# Streamlit app title
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import VisionEncoderDecoderModel, ViTImageProcessor, GPT2Tokenizer, AutoImageProcessor
|
3 |
import torch
|
4 |
from PIL import Image
|
5 |
|
6 |
# Load the model and tokenizer
|
7 |
model = VisionEncoderDecoderModel.from_pretrained("ashok2216/vit-gpt2-image-captioning_COCO_FineTuned")
|
8 |
+
# processor = ViTImageProcessor.from_pretrained("ashok2216/vit-gpt2-image-captioning_COCO_FineTuned")
|
9 |
+
processor = AutoImageProcessor.from_pretrained("ashok2216/vit-gpt2-image-captioning_COCO_FineTuned")
|
10 |
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
|
11 |
|
12 |
# Streamlit app title
|