ashok2216 commited on
Commit
70c2a12
·
verified ·
1 Parent(s): df5ee2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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