Spaces:
Runtime error
Runtime error
Upload gradio_app.py
Browse files- 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 |
-
|
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 =
|
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("'", "'")
|
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 |
|