Spaces:
Configuration error
Configuration error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True,
|
|
| 9 |
model = model.eval().cuda()
|
| 10 |
|
| 11 |
@spaces.GPU
|
| 12 |
-
def run_GOT(image_array, got_mode,
|
| 13 |
image = image_array
|
| 14 |
if got_mode == "plain texts OCR":
|
| 15 |
res = model.chat(tokenizer, image, ocr_type='ocr')
|
|
@@ -135,7 +135,7 @@ with gr.Blocks() as demo:
|
|
| 135 |
|
| 136 |
submit_button.click(
|
| 137 |
run_GOT,
|
| 138 |
-
inputs=[image_input, task_dropdown,
|
| 139 |
outputs=[ocr_result, html_result]
|
| 140 |
)
|
| 141 |
|
|
|
|
| 9 |
model = model.eval().cuda()
|
| 10 |
|
| 11 |
@spaces.GPU
|
| 12 |
+
def run_GOT(image_array, got_mode, fine_grained_mode="", ocr_color="", ocr_box=""):
|
| 13 |
image = image_array
|
| 14 |
if got_mode == "plain texts OCR":
|
| 15 |
res = model.chat(tokenizer, image, ocr_type='ocr')
|
|
|
|
| 135 |
|
| 136 |
submit_button.click(
|
| 137 |
run_GOT,
|
| 138 |
+
inputs=[image_input, task_dropdown, fine_grained_dropdown, color_dropdown, box_input],
|
| 139 |
outputs=[ocr_result, html_result]
|
| 140 |
)
|
| 141 |
|