import os import sys # Compute the path to 'Source Code' and add it to sys.path source_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Source Code") sys.path.insert(0, source_dir) # Change the current working directory to 'Source Code' os.chdir(source_dir) # Import the main app logic from Source Code/app.py import app # Manually trigger the Gradio launch, because importing the module bypasses the __main__ block app.demo.queue().launch( server_name="0.0.0.0", server_port=7860, show_error=True, pwa=True, allowed_paths=[str(app.DATASET_DIR)] )