import os import gradio as gr from app import create_app # Set environment variables for Hugging Face Space os.environ["GEMINI_API_KEY"] = os.getenv("GEMINI_API_KEY", "") def main(): """Entry point for Hugging Face Spaces""" try: # Create the app app = create_app() # Launch for Hugging Face Space app.launch( share=False, # HF Spaces don't need share=True server_name="0.0.0.0", server_port=7860, show_error=True ) except Exception as e: print(f"❌ Application startup error: {e}") raise if __name__ == "__main__": main()