Hunyuan-MT / app.py
minhho's picture
Fix app.py: Use exec() to properly execute gradio_app as __main__
998bf82
#!/usr/bin/env python3
"""
HuggingFace Space entry point for Hunyuan3D-2.1
This script executes gradio_app.py with the correct arguments.
"""
import sys
import os
# Set working directory to script location
os.chdir(os.path.dirname(os.path.abspath(__file__)))
# Configure arguments for gradio_app.py
# Clear sys.argv completely and set only what we need
sys.argv = [
'gradio_app.py',
'--host', '0.0.0.0',
'--port', '7860'
]
# Execute gradio_app.py as __main__ module
# We use exec() to run the code with __name__ == '__main__'
if __name__ == '__main__':
with open('gradio_app.py', 'r') as f:
code = f.read()
exec(code, {'__name__': '__main__', '__file__': 'gradio_app.py'})