|
|
|
""" |
|
PodcastMcpGradio - Main Entry Point |
|
|
|
This is the main entry point for the PodcastMcpGradio application. |
|
It supports both local and Modal deployment modes. |
|
""" |
|
|
|
import os |
|
import sys |
|
|
|
|
|
current_dir = os.path.dirname(os.path.abspath(__file__)) |
|
sys.path.insert(0, current_dir) |
|
|
|
|
|
is_hf_spaces = "SPACE_ID" in os.environ |
|
|
|
|
|
app = None |
|
|
|
if is_hf_spaces: |
|
|
|
print("π€ Detected HF Spaces environment") |
|
os.environ["DEPLOYMENT_MODE"] = "local" |
|
os.environ["HF_SPACES_MODE"] = "1" |
|
|
|
|
|
from src.app import create_app |
|
app = create_app() |
|
print("β
App created for HF Spaces") |
|
|
|
else: |
|
|
|
from src.app import create_app, main, get_app |
|
|
|
|
|
__all__ = ["create_app", "main", "get_app", "app"] |
|
|
|
if __name__ == "__main__": |
|
|
|
print("π Local development mode") |
|
from src.app import run_local |
|
run_local() |
|
else: |
|
|
|
app = get_app() |
|
|
|
|
|
if app is None and not __name__ == "__main__": |
|
print("β οΈ Creating fallback app") |
|
from src.app import get_app |
|
app = get_app() |