Spaces:
Running
Running
gryan-galario
commited on
Commit
•
e9dcd8e
1
Parent(s):
ff3e8f8
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import AutoTokenizer, AutoModel,
|
3 |
from PIL import Image
|
4 |
import requests
|
5 |
import torch
|
@@ -7,7 +7,7 @@ import torch
|
|
7 |
|
8 |
tokenizer = AutoTokenizer.from_pretrained("kha-white/manga-ocr-base")
|
9 |
|
10 |
-
model =
|
11 |
|
12 |
feature_extractor = AutoFeatureExtractor.from_pretrained("kha-white/manga-ocr-base")
|
13 |
|
@@ -28,7 +28,7 @@ def manga_ocr(img):
|
|
28 |
return text
|
29 |
|
30 |
iface = gr.Interface(
|
31 |
-
fn=
|
32 |
inputs=[gr.inputs.Image(label="Input", type="pil")],
|
33 |
outputs="text",
|
34 |
layout="horizontal",
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoTokenizer, AutoModel, VisionEncoderDecoderModel
|
3 |
from PIL import Image
|
4 |
import requests
|
5 |
import torch
|
|
|
7 |
|
8 |
tokenizer = AutoTokenizer.from_pretrained("kha-white/manga-ocr-base")
|
9 |
|
10 |
+
model = VisionEncoderDecoderModel.from_pretrained("kha-white/manga-ocr-base")
|
11 |
|
12 |
feature_extractor = AutoFeatureExtractor.from_pretrained("kha-white/manga-ocr-base")
|
13 |
|
|
|
28 |
return text
|
29 |
|
30 |
iface = gr.Interface(
|
31 |
+
fn=manga_ocr,
|
32 |
inputs=[gr.inputs.Image(label="Input", type="pil")],
|
33 |
outputs="text",
|
34 |
layout="horizontal",
|