Spaces:
Running
on
Zero
Running
on
Zero
Upload folder using huggingface_hub
Browse files- hg_app.py +7 -3
- requirements.txt +1 -1
hg_app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# pip install gradio==4.44.1
|
2 |
-
if
|
3 |
import os
|
4 |
import spaces
|
5 |
import subprocess
|
@@ -137,8 +137,12 @@ def build_model_viewer_html(save_folder, height=660, width=790, textured=False):
|
|
137 |
f.write(template_html.replace('<model-viewer>', obj_html))
|
138 |
|
139 |
output_html_path = output_html_path.replace(SAVE_DIR + '/', '')
|
140 |
-
iframe_tag = f'<iframe src="/static/{output_html_path}" height="{height}" width="100%" frameborder="0"></iframe>'
|
141 |
-
print(f'Find html {output_html_path}, {os.path.exists(output_html_path)}')
|
|
|
|
|
|
|
|
|
142 |
|
143 |
return f"""
|
144 |
<div style='height: {height}; width: 100%;'>
|
|
|
1 |
# pip install gradio==4.44.1
|
2 |
+
if False:
|
3 |
import os
|
4 |
import spaces
|
5 |
import subprocess
|
|
|
137 |
f.write(template_html.replace('<model-viewer>', obj_html))
|
138 |
|
139 |
output_html_path = output_html_path.replace(SAVE_DIR + '/', '')
|
140 |
+
#iframe_tag = f'<iframe src="/static/{output_html_path}" height="{height}" width="100%" frameborder="0"></iframe>'
|
141 |
+
# print(f'Find html {output_html_path}, {os.path.exists(output_html_path)}')
|
142 |
+
|
143 |
+
rel_path = os.path.relpath(output_html_path, SAVE_DIR)
|
144 |
+
iframe_tag = f'<iframe src="/static/{rel_path}" height="{height}" width="100%" frameborder="0"></iframe>'
|
145 |
+
print(f'Find html file {output_html_path}, {os.path.exists(output_html_path)}, relative HTML path is /static/{rel_path}')
|
146 |
|
147 |
return f"""
|
148 |
<div style='height: {height}; width: 100%;'>
|
requirements.txt
CHANGED
@@ -32,5 +32,5 @@ pygltflib
|
|
32 |
sentencepiece
|
33 |
gradio
|
34 |
uvicorn
|
35 |
-
fastapi
|
36 |
wheel
|
|
|
32 |
sentencepiece
|
33 |
gradio
|
34 |
uvicorn
|
35 |
+
fastapi==0.112.2
|
36 |
wheel
|