Spaces:
Runtime error
Runtime error
Upload app.py with huggingface_hub
Browse files2 unmodified lines34567893 unmodified lines13141516171819202122232425262728293031323334353637383940414243444546474849505152532 unmodified linesPodcastMcpGradio - Main Entry PointThis is the main entry point for the PodcastMcpGradio application.It supports both local and Modal deployment modes."""import os3 unmodified linescurrent_dir = os.path.dirname(os.path.abspath(__file__))sys.path.insert(0, current_dir)# Detect environment earlyis_hf_spaces = "SPACE_ID" in os.environ# Initialize app variable at module levelapp = Noneif is_hf_spaces:# HF Spaces mode: Set environment and create appprint("🤗 Detected HF Spaces environment")os.environ["DEPLOYMENT_MODE"] = "local"os.environ["HF_SPACES_MODE"] = "1" # Flag to prevent uvicorn# Import and create app directlyfrom src.app import create_appapp = create_app()print("✅ App created for HF Spaces")else:# For other environmentsfrom src.app import create_app, main, get_app# Re-export for compatibility__all__ = ["create_app", "main", "get_app", "app"]if __name__ == "__main__":# Local development mode: use uvicornprint("🏠 Local development mode")from src.app import run_localrun_local()else:# Other environmentsapp = get_app()# Ensure app is always defined at module level for HF Spacesif app is None and not __name__ == "__main__":print("⚠️ Creating fallback app")from src.app import get_appapp = get_app()2 unmodified lines34567893 unmodified lines13141516171819202122232425262728292 unmodified linesPodcastMcpGradio - Main Entry PointThis is the main entry point for the PodcastMcpGradio application.Simplified for Hugging Face Spaces deployment."""import os3 unmodified linescurrent_dir = os.path.dirname(os.path.abspath(__file__))sys.path.insert(0, current_dir)# Set environment for HF Spacesos.environ.setdefault("DEPLOYMENT_MODE", "local")os.environ.setdefault("HF_SPACES_MODE", "1")# Import and create appfrom src.app import create_app, run_local# Create app instanceapp = create_app()if __name__ == "__main__":# Run the applicationprint("🚀 Starting PodcastMcpGradio application")run_local()
app.py+12-36