ipvikas commited on
Commit
16cc5c7
·
1 Parent(s): 1d305df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,9 +1,13 @@
1
  import os
2
  import gradio as gr
3
 
 
 
 
 
4
 
5
- from transformers import VisionEncoderDecoderModel
6
 
 
7
  # initialize a vit-bert from a pretrained ViT and a pretrained BERT model. Note that the cross-attention layers will be randomly initialized
8
  model = VisionEncoderDecoderModel.from_encoder_decoder_pretrained(
9
  "google/vit-base-patch16-224-in21k", "bert-base-uncased"
 
1
  import os
2
  import gradio as gr
3
 
4
+ from transformers import ViTFeatureExtractor
5
+ feature_extractor = ViTFeatureExtractor()
6
+ # or, to load one that corresponds to a checkpoint on the hub:
7
+ feature_extractor = ViTFeatureExtractor.from_pretrained("google/vit-base-patch16-224")
8
 
 
9
 
10
+ from transformers import VisionEncoderDecoderModel
11
  # initialize a vit-bert from a pretrained ViT and a pretrained BERT model. Note that the cross-attention layers will be randomly initialized
12
  model = VisionEncoderDecoderModel.from_encoder_decoder_pretrained(
13
  "google/vit-base-patch16-224-in21k", "bert-base-uncased"