premanth15 commited on
Commit
20dc7c2
·
verified ·
1 Parent(s): 13250bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,9 +5,9 @@ from transformers import AutoTokenizer, ViTImageProcessor, VisionEncoderDecoderM
5
  device = 'cpu'
6
 
7
  # Load the pretrained model, feature extractor, and tokenizer
8
- model = VisionEncoderDecoderModel.from_pretrained("nlpconnect/vit-gpt2-image-captioning").to(device)
9
- feature_extractor = ViTImageProcessor.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
10
- tokenizer = AutoTokenizer.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
11
 
12
  def predict(image, max_length=64, num_beams=4):
13
  # Process the input image
 
5
  device = 'cpu'
6
 
7
  # Load the pretrained model, feature extractor, and tokenizer
8
+ model = VisionEncoderDecoderModel.from_pretrained("premanthcharan/Image_Captioning_Model").to(device)
9
+ feature_extractor = ViTImageProcessor.from_pretrained("premanthcharan/Image_Captioning_Model")
10
+ tokenizer = AutoTokenizer.from_pretrained("premanthcharan/Image_Captioning_Model")
11
 
12
  def predict(image, max_length=64, num_beams=4):
13
  # Process the input image