Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 3D viewer not loading due to HTML path issue in gradio_app.py #20

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

TMRolle
Copy link
Contributor

@TMRolle TMRolle commented Jan 22, 2025

This small patch fixes a logical error in gradio_app.py, causing the generated HTML to contain the filepath relative to app root rather than relative to the served /static/ directory. Before the patch, the generated iframe_tag would contain incorrect references such as /static/./gradio_cache/5/white_mesh.html.

This fix uses os.path.relpath() to strip SAVE_DIR from the prefix, thus giving the correct path relative to the static cache directory, ex: /static/5/white_mesh.html

TMRolle and others added 2 commits January 21, 2025 22:09
This small patch fixes a logical error in gradio_app.py, causing the generated HTML to contain the filepath relative to app root rather than relative to /static/. Before the patch, the generated `iframe_tag` would contain incorrect references such as `/static/./gradio_cache/5/white_mesh.html`. 

This fix uses `os.path.relpath()` to strip `SAVE_DIR` from the prefix, thus giving the correct path relative to the static cache directory, ex:  `/static/5/white_mesh.html`
@Zeqiang-Lai Zeqiang-Lai merged commit 86c2bdf into Tencent:main Jan 23, 2025
1 check passed
YanWenKun added a commit to YanWenKun/Hunyuan3D-2 that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants