Spaces:
Runtime error
Runtime error
seanbenhur
commited on
Commit
·
9527ffe
1
Parent(s):
969520d
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import torch
|
2 |
import re
|
3 |
import gradio as gr
|
4 |
-
from transformers import
|
5 |
|
6 |
|
7 |
device = 'cpu'
|
@@ -9,7 +9,7 @@ encoder_checkpoint = 'google/vit-base-patch16-224'
|
|
9 |
decoder_checkpoint = 'surajp/gpt2-hindi'
|
10 |
model_checkpoint = 'team-indain-image-caption/hindi-image-captioning'
|
11 |
feature_extractor = ViTFeatureExtractor.from_pretrained(encoder_checkpoint)
|
12 |
-
tokenizer =
|
13 |
model = VisionEncoderDecoderModel.from_pretrained(model_checkpoint).to(device)
|
14 |
|
15 |
|
|
|
1 |
import torch
|
2 |
import re
|
3 |
import gradio as gr
|
4 |
+
from transformers import AutoTokenizer, ViTFeatureExtractor, VisionEncoderDecoderModel
|
5 |
|
6 |
|
7 |
device = 'cpu'
|
|
|
9 |
decoder_checkpoint = 'surajp/gpt2-hindi'
|
10 |
model_checkpoint = 'team-indain-image-caption/hindi-image-captioning'
|
11 |
feature_extractor = ViTFeatureExtractor.from_pretrained(encoder_checkpoint)
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained(decoder_checkpoint)
|
13 |
model = VisionEncoderDecoderModel.from_pretrained(model_checkpoint).to(device)
|
14 |
|
15 |
|