File size: 780 Bytes
585f232
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Run the app on this machine: loads ../.env (the Space gets these values as secrets), keeps the user database out
of the repository, then starts app.py.   python devtools/run_local.py"""
import os
import runpy
import sys
import tempfile
from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT))
sys.path.insert(0, str(Path(__file__).resolve().parent))
import env  # noqa: E402

env.load()
os.environ.setdefault("USERS_DB", str(Path(tempfile.gettempdir()) / "cs_suite_dev_users.db"))
os.environ.setdefault("LT_MODE", "off")              # LanguageTool needs Java + a 260 MB download: opt in with LT_MODE=local
os.environ.setdefault("GRADIO_SERVER_PORT", "7860")
os.chdir(ROOT)
runpy.run_path(str(ROOT / "app.py"), run_name="__main__")