Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,11 +10,13 @@ import torch
|
|
10 |
|
11 |
from donut import DonutModel
|
12 |
|
|
|
13 |
def demo_process(input_img):
|
14 |
global pretrained_model, task_prompt, task_name
|
15 |
output = pretrained_model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
16 |
return output["text_sequence"].replace(" ", "") # temp
|
17 |
|
|
|
18 |
task_prompt = f"<s_kuzushiji>"
|
19 |
pretrained_model = DonutModel.from_pretrained("naver-clova-ix/donut-base-finetuned-kuzushiji")
|
20 |
pretrained_model.eval()
|
|
|
10 |
|
11 |
from donut import DonutModel
|
12 |
|
13 |
+
|
14 |
def demo_process(input_img):
|
15 |
global pretrained_model, task_prompt, task_name
|
16 |
output = pretrained_model.inference(image=input_img, prompt=task_prompt)["predictions"][0]
|
17 |
return output["text_sequence"].replace(" ", "") # temp
|
18 |
|
19 |
+
|
20 |
task_prompt = f"<s_kuzushiji>"
|
21 |
pretrained_model = DonutModel.from_pretrained("naver-clova-ix/donut-base-finetuned-kuzushiji")
|
22 |
pretrained_model.eval()
|