Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from transformers import VisionEncoderDecoderModel, ViTFeatureExtractor, AutoTok
|
|
5 |
#pickle.load(open('energy_model.pkl', 'rb'))
|
6 |
#vocab = np.load('w2i.p', allow_pickle=True)
|
7 |
st.title("Image_Captioning_App")
|
8 |
-
@st.
|
9 |
def load_models():
|
10 |
model = VisionEncoderDecoderModel.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
11 |
feature_extractor = ViTFeatureExtractor.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
|
|
5 |
#pickle.load(open('energy_model.pkl', 'rb'))
|
6 |
#vocab = np.load('w2i.p', allow_pickle=True)
|
7 |
st.title("Image_Captioning_App")
|
8 |
+
@st.cache
|
9 |
def load_models():
|
10 |
model = VisionEncoderDecoderModel.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|
11 |
feature_extractor = ViTFeatureExtractor.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
|