NicolasG2523 commited on
Commit
233a938
Β·
verified Β·
1 Parent(s): 9b18af1

Upload gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +1 -7
gradio_app.py CHANGED
@@ -139,17 +139,11 @@ def build_model_viewer_html(save_folder, height=660, width=790, textured=False):
139
  template_html = template_html.replace('#height#', f'{height - offset}')
140
  template_html = template_html.replace('#width#', f'{width}')
141
  #template_html = template_html.replace('#src#', f'{related_path}/')
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
-
149
- print(f'Find html file {output_html_path}, {os.path.exists(output_html_path)}')
150
- print(iframe_tag)
151
-
152
- print(template_html)
153
 
154
  return f"""
155
  <div style='height: {height}; width: 100%;'>
 
139
  template_html = template_html.replace('#height#', f'{height - offset}')
140
  template_html = template_html.replace('#width#', f'{width}')
141
  #template_html = template_html.replace('#src#', f'{related_path}/')
142
+ template_html = template_html.replace('#src#', f'https://nicolasg2523-picsto3d.hf.space/gradio_api/file=/tmp/{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
 
148
  return f"""
149
  <div style='height: {height}; width: 100%;'>