Mageia commited on
Commit
3db4b7a
·
unverified ·
1 Parent(s): fffa248

fix: got_ocr

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -92,9 +92,12 @@ def perform_ocr(selected_index, image_gallery, got_mode, fine_grained_type, colo
92
  )
93
 
94
  if html_content:
95
- return gr.HTML(f'<iframe srcdoc="{html_content}" width="100%" height="600px"></iframe>')
 
 
 
96
  else:
97
- return result
98
 
99
 
100
  def task_update(task):
 
92
  )
93
 
94
  if html_content:
95
+ iframe_src = f"data:text/html;base64,{html_content}"
96
+ iframe = f'<iframe src="{iframe_src}" width="100%" height="600px"></iframe>'
97
+ download_link = f'<a href="data:text/html;base64,{html_content}" download="result.html">下载完整结果</a>'
98
+ return gr.Markdown(f"{download_link}\n\n{iframe}")
99
  else:
100
+ return gr.Markdown(result)
101
 
102
 
103
  def task_update(task):