Spaces:
Runtime error
Runtime error
fix: delete commented text
Browse files
app.py
CHANGED
|
@@ -12,31 +12,4 @@ def demo_process(input_img):
|
|
| 12 |
|
| 13 |
task_prompt = f"<s>"
|
| 14 |
|
| 15 |
-
st.text('This model is trained with receipt images -> SROIE dataset.')
|
| 16 |
-
|
| 17 |
-
"""image = Image.open("./sample_image_1.png")
|
| 18 |
-
image.save("receipt1.png")
|
| 19 |
-
image = Image.open("./sample_image_2.png")
|
| 20 |
-
image.save("receipt2.png")
|
| 21 |
-
|
| 22 |
-
pretrained_model = VisionEncoderDecoderModel.from_pretrained("unstructured/donut-base-sroie")
|
| 23 |
-
pretrained_model.encoder.to(torch.bfloat16)
|
| 24 |
-
pretrained_model.eval()
|
| 25 |
-
|
| 26 |
-
# replace for streamlit widgets
|
| 27 |
-
demo = gr.Interface(
|
| 28 |
-
fn=demo_process,
|
| 29 |
-
inputs= gr.inputs.Image(type="pil"),
|
| 30 |
-
outputs="json",
|
| 31 |
-
title=f"Donut 🍩 demonstration for `cord-v2` task",
|
| 32 |
-
description="""This model is trained with 800 Indonesian receipt images of CORD dataset. <br>
|
| 33 |
-
Demonstrations for other types of documents/tasks are available at https://github.com/clovaai/donut <br>
|
| 34 |
-
More CORD receipt images are available at https://huggingface.co/datasets/naver-clova-ix/cord-v2
|
| 35 |
-
More details are available at:
|
| 36 |
-
- Paper: https://arxiv.org/abs/2111.15664
|
| 37 |
-
- GitHub: https://github.com/clovaai/donut""",
|
| 38 |
-
examples=[["receipt1.png"], ["receipt2.png"]],
|
| 39 |
-
cache_examples=False,
|
| 40 |
-
)
|
| 41 |
-
|
| 42 |
-
demo.launch()"""
|
|
|
|
| 12 |
|
| 13 |
task_prompt = f"<s>"
|
| 14 |
|
| 15 |
+
st.text('This model is trained with receipt images -> SROIE dataset.')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|