NicolasG2523 commited on
Commit
9b18af1
·
verified ·
1 Parent(s): b7af6bf

Upload gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +2 -2
gradio_app.py CHANGED
@@ -28,7 +28,7 @@ from fastapi.staticfiles import StaticFiles
28
  import uuid
29
 
30
  import base64
31
- from html import escape
32
 
33
  from hy3dgen.shapegen.utils import logger
34
 
@@ -142,7 +142,7 @@ def build_model_viewer_html(save_folder, height=660, width=790, textured=False):
142
  template_html = template_html.replace('#src#', f'{mesh_file_path}/')
143
  f.write(template_html)
144
 
145
- tenplate_html_encoded = encode(tenplate_html)
146
  iframe_tag = f'<iframe srcdoc="{tenplate_html_encoded}" height="{height}" width="100%" frameborder="0"></iframe>'
147
  #iframe_tag = f'<iframe src="file=https://nicolasg2523-picsto3d.hf.space/gradio_api/file=/tmp{output_html_path}" height="{height}" width="100%" frameborder="0"></iframe>'
148
 
 
28
  import uuid
29
 
30
  import base64
31
+ import html
32
 
33
  from hy3dgen.shapegen.utils import logger
34
 
 
142
  template_html = template_html.replace('#src#', f'{mesh_file_path}/')
143
  f.write(template_html)
144
 
145
+ tenplate_html_encoded = html.escape(template_html, quote=True).replace("'", "&apos;")
146
  iframe_tag = f'<iframe srcdoc="{tenplate_html_encoded}" height="{height}" width="100%" frameborder="0"></iframe>'
147
  #iframe_tag = f'<iframe src="file=https://nicolasg2523-picsto3d.hf.space/gradio_api/file=/tmp{output_html_path}" height="{height}" width="100%" frameborder="0"></iframe>'
148