Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ def create_caption_transformer(img):
|
|
20 |
|
21 |
|
22 |
torch.__version__
|
23 |
-
IMAGES_EXAMPLES_FOLDER = 'examples/'
|
24 |
images = os.listdir(IMAGES_EXAMPLES_FOLDER)
|
25 |
IMAGES_EXAMPLES = [IMAGES_EXAMPLES_FOLDER + img for img in images]
|
26 |
model = VisionEncoderDecoderModel.from_pretrained(os.getcwd()).to('cpu')
|
@@ -28,6 +28,6 @@ feature_extractor = AutoFeatureExtractor.from_pretrained('google/vit-base-patch1
|
|
28 |
tokenizer = AutoTokenizer.from_pretrained('gpt2')
|
29 |
iface = gr.Interface(fn=create_caption_transformer,
|
30 |
inputs="image",
|
31 |
-
outputs='text'
|
32 |
-
examples=IMAGES_EXAMPLES
|
33 |
).launch(share=True)
|
|
|
20 |
|
21 |
|
22 |
torch.__version__
|
23 |
+
#IMAGES_EXAMPLES_FOLDER = 'examples/'
|
24 |
images = os.listdir(IMAGES_EXAMPLES_FOLDER)
|
25 |
IMAGES_EXAMPLES = [IMAGES_EXAMPLES_FOLDER + img for img in images]
|
26 |
model = VisionEncoderDecoderModel.from_pretrained(os.getcwd()).to('cpu')
|
|
|
28 |
tokenizer = AutoTokenizer.from_pretrained('gpt2')
|
29 |
iface = gr.Interface(fn=create_caption_transformer,
|
30 |
inputs="image",
|
31 |
+
outputs='text'
|
32 |
+
#, examples=IMAGES_EXAMPLES
|
33 |
).launch(share=True)
|