NourFakih commited on
Commit
3f84488
·
verified ·
1 Parent(s): 921ba61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -7,11 +7,11 @@ import csv
7
  from PIL import Image
8
 
9
  device = 'cpu'
10
-
11
  # Load the pretrained model, feature extractor, and tokenizer
12
- model = VisionEncoderDecoderModel.from_pretrained("NourFakih/Vit-GPT2-COCO2017Flickr-02").to(device)
13
- feature_extractor = ViTImageProcessor.from_pretrained("NourFakih/Vit-GPT2-COCO2017Flickr-02")
14
- tokenizer = AutoTokenizer.from_pretrained("NourFakih/Vit-GPT2-COCO2017Flickr-02")
15
 
16
  def predict(image, max_length=64, num_beams=4):
17
  # Process the input image
 
7
  from PIL import Image
8
 
9
  device = 'cpu'
10
+ model_name="NourFakih/Vit-GPT2-COCO2017Flickr-40k-04"
11
  # Load the pretrained model, feature extractor, and tokenizer
12
+ model = VisionEncoderDecoderModel.from_pretrained(model_name).to(device)
13
+ feature_extractor = ViTImageProcessor.from_pretrained(model_name)
14
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
15
 
16
  def predict(image, max_length=64, num_beams=4):
17
  # Process the input image