Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,11 @@ feature_extractor = AutoFeatureExtractor.from_pretrained(model_path)
|
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
11 |
model = VisionEncoderDecoderModel.from_pretrained(model_path)
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
def post_process(text):
|
15 |
text = ''.join(text.split())
|
16 |
text = text.replace('…', '...')
|
@@ -37,5 +41,6 @@ iface = gr.Interface(
|
|
37 |
description="A simple interface for OCR from Japanese manga",
|
38 |
article= "Author: <a href=\"https://huggingface.co/vumichien\">Vu Minh Chien</a>. ",
|
39 |
allow_flagging='never',
|
|
|
40 |
)
|
41 |
-
iface.launch(enable_queue=True,
|
|
|
10 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
11 |
model = VisionEncoderDecoderModel.from_pretrained(model_path)
|
12 |
|
13 |
+
examples = ['examples/01.png', 'examples/02.png', 'examples/03.png',
|
14 |
+
'examples/04.png', 'examples/05.png', 'examples/06.png',
|
15 |
+
'examples/07.png'
|
16 |
+
]
|
17 |
+
|
18 |
def post_process(text):
|
19 |
text = ''.join(text.split())
|
20 |
text = text.replace('…', '...')
|
|
|
41 |
description="A simple interface for OCR from Japanese manga",
|
42 |
article= "Author: <a href=\"https://huggingface.co/vumichien\">Vu Minh Chien</a>. ",
|
43 |
allow_flagging='never',
|
44 |
+
examples=examples
|
45 |
)
|
46 |
+
iface.launch(enable_queue=True, cache_examples=True)
|