Spaces:
Sleeping
Sleeping
File size: 1,021 Bytes
7248d39 | 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 28 29 30 31 32 33 34 35 | import asyncio
import os
import sys
import warnings
os.environ.setdefault("GRADIO_ANALYTICS_ENABLED", "False")
# Gradio startup probes create short-lived asyncio loops; Python 3.11 can log
# harmless "Invalid file descriptor: -1" noise when those loops are GC'd.
if not getattr(asyncio.base_events.BaseEventLoop, "_finsight_safe_del", False):
_orig_loop_del = asyncio.base_events.BaseEventLoop.__del__
def _safe_loop_del(self) -> None:
try:
_orig_loop_del(self)
except (ValueError, RuntimeError):
pass
asyncio.base_events.BaseEventLoop.__del__ = _safe_loop_del
asyncio.base_events.BaseEventLoop._finsight_safe_del = True
warnings.filterwarnings("ignore", message=".*HTTP_422_UNPROCESSABLE_ENTITY.*")
from pathlib import Path
backend_dir = Path(__file__).parent / "backend"
sys.path.insert(0, str(backend_dir))
from gradio_ui.app import create_demo, launch_demo
demo, theme, css = create_demo()
if __name__ == "__main__":
launch_demo(demo, theme, css)
|