""" Hugging Face Space entry point for Legal Deed Reviewer. This file is optimized for deployment on Hugging Face Spaces. """ import sys import os # Ensure the current directory is in the path sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) # Import the Gradio app (not the FastAPI wrapper) from web_app import gradio_app # Export for Hugging Face Spaces # Spaces will automatically detect and launch the 'gradio_app' or 'demo' variable demo = gradio_app # Optional: Launch configuration for local testing if __name__ == "__main__": demo.launch( server_name="0.0.0.0", server_port=7860, # Default Gradio port for Spaces share=False, show_error=True, ssr_mode=False, # Disable SSR to fix blank screen issues root_path=os.environ.get("GRADIO_ROOT_PATH", "") # Fix HF Spaces proxy )