Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -222,21 +222,10 @@ def process_and_output_files(input_files):
|
|
222 |
chats[1]["value"][0][1] ,
|
223 |
)
|
224 |
|
225 |
-
|
226 |
|
227 |
-
# df = pd.DataFrame(data_dicts)
|
228 |
-
original_data = [json.loads(item) for item in data]
|
229 |
|
230 |
-
|
231 |
-
for item in original_data:
|
232 |
-
string_item = {key: str(value) for key, value in item.items()}
|
233 |
-
string_data.append(string_item)
|
234 |
-
|
235 |
-
df = pd.DataFrame(string_data)
|
236 |
-
table_html = df.to_html(classes="table table-bordered", index=False)
|
237 |
-
|
238 |
-
scrollable_table = f'<div style="overflow-x: auto;">{table_html}</div>'
|
239 |
-
return scrollable_table
|
240 |
|
241 |
|
242 |
|
@@ -333,8 +322,7 @@ with gr.Blocks(title="Automatic Reimbursement Tool Demo") as page:
|
|
333 |
interactive=False,
|
334 |
height=240,
|
335 |
)
|
336 |
-
|
337 |
-
information = gr.HTML()
|
338 |
|
339 |
with gr.Row():
|
340 |
flag_incorrect_button = gr.Button(
|
@@ -446,4 +434,4 @@ page.queue(
|
|
446 |
concurrency_count=20,
|
447 |
max_size=1,
|
448 |
)
|
449 |
-
page.launch(show_api=True, show_error=True, debug=True)
|
|
|
222 |
chats[1]["value"][0][1] ,
|
223 |
)
|
224 |
|
225 |
+
data_dicts = [json.loads(item[0]) for item in data]
|
226 |
|
|
|
|
|
227 |
|
228 |
+
return data_dicts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
|
230 |
|
231 |
|
|
|
322 |
interactive=False,
|
323 |
height=240,
|
324 |
)
|
325 |
+
information = gr.JSON(label="Extracted information")
|
|
|
326 |
|
327 |
with gr.Row():
|
328 |
flag_incorrect_button = gr.Button(
|
|
|
434 |
concurrency_count=20,
|
435 |
max_size=1,
|
436 |
)
|
437 |
+
page.launch(show_api=True, show_error=True, debug=True)
|