Spaces:
Sleeping
Sleeping
File size: 916 Bytes
73a267e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """
Example launcher that keeps the original code untouched.
Place this file alongside the existing app module and adjust the import path if needed.
Run this launcher instead of the original entry point.
"""
import importlib.util
import sys
from pathlib import Path
ORIGINAL_APP_PATH = Path("dvnc_ai_v2_hf/app.py")
PATCH_PATH = Path("dvnc_flip_insight_patch.py")
spec = importlib.util.spec_from_file_location("dvnc_original_app", ORIGINAL_APP_PATH)
mod = importlib.util.module_from_spec(spec)
sys.modules["dvnc_original_app"] = mod
spec.loader.exec_module(mod)
patch_spec = importlib.util.spec_from_file_location("dvnc_flip_insight_patch", PATCH_PATH)
patch = importlib.util.module_from_spec(patch_spec)
sys.modules["dvnc_flip_insight_patch"] = patch
patch_spec.loader.exec_module(patch)
patch.apply_patch(mod)
# If the original app exposes demo/launch objects, they remain on mod.
# Example: mod.demo.launch() |