Spaces:
Sleeping
Sleeping
nickgambirasi
commited on
Commit
•
30b460c
1
Parent(s):
c211276
update app
Browse files
app.py
CHANGED
@@ -40,13 +40,13 @@ def process_document(image):
|
|
40 |
sequence = sequence.replace(processor.tokenizer.eos_token, "").replace(processor.tokenizer.pad_token, "")
|
41 |
sequence = re.sub(r"<.*?>", "", sequence).strip() # remove first task start token
|
42 |
|
43 |
-
return sequence
|
44 |
|
45 |
demo = gradio.Interface(
|
46 |
fn=process_document,
|
47 |
inputs="image",
|
48 |
-
outputs="
|
49 |
-
title="
|
50 |
description=None,
|
51 |
article=None,
|
52 |
examples=None,
|
|
|
40 |
sequence = sequence.replace(processor.tokenizer.eos_token, "").replace(processor.tokenizer.pad_token, "")
|
41 |
sequence = re.sub(r"<.*?>", "", sequence).strip() # remove first task start token
|
42 |
|
43 |
+
return {'output': sequence}
|
44 |
|
45 |
demo = gradio.Interface(
|
46 |
fn=process_document,
|
47 |
inputs="image",
|
48 |
+
outputs="json",
|
49 |
+
title="Donut Text Parsing",
|
50 |
description=None,
|
51 |
article=None,
|
52 |
examples=None,
|