| """ | |
| Hugging Face Production Runtime Wrapper. | |
| Uses clean top-level paths to completely eliminate circular naming loops. | |
| """ | |
| import os | |
| import sys | |
| sys.path.append(os.path.dirname(os.path.abspath(__file__))) | |
| # Now import your interface | |
| from app.application_interface import interface_assembly | |
| if __name__ == "__main__": | |
| interface_assembly.launch() | |
| # Compute root project directory absolute path | |
| PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | |
| # Insert project root at the very front of the path lookup array | |
| if PROJECT_ROOT not in sys.path: | |
| sys.path.insert(0, PROJECT_ROOT) | |
| # Import the interface runtime assembly safely from the app folder package | |
| from app.application_interface import interface_assembly | |
| if __name__ == "__main__": | |
| # Force server name to 0.0.0.0 and disable sharing mechanisms for cloud deployment | |
| interface_assembly.launch( | |
| server_name="0.0.0.0", | |
| server_port=7860, | |
| share=False | |
| ) |