Skip to content

Commit a66c5e2

Browse files
committed
format with json.dumps
1 parent 6ffcdc9 commit a66c5e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gradio_demo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from PIL import Image
77
import io
88

9-
import base64, os
9+
import base64, json, os
1010
from utils import check_ocr_box, get_yolo_model, get_caption_model_processor, get_som_labeled_img
1111
import torch
1212
from PIL import Image
@@ -77,7 +77,8 @@ def process(
7777
"parsed_content_list": parsed_content_list,
7878
"label_coordinates": label_coordinates,
7979
}
80-
return image, str(output_dict)
80+
combined_text_output = json.dumps(output_dict, indent=2)
81+
return image, combined_text_output
8182

8283

8384
with gr.Blocks() as demo:

0 commit comments

Comments
 (0)