Spaces:
Running
Running
File size: 1,169 Bytes
61ff229 de2a93c 61ff229 de2a93c 61ff229 891a9ba 61ff229 de2a93c 61ff229 de2a93c 61ff229 de2a93c 61ff229 | 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 36 37 38 39 40 41 42 43 44 45 | # Hugging Face Space entry — Universal Brain chat (generated by build_space_artifact.py).
from __future__ import annotations
import os
import sys
from pathlib import Path
_ROOT = Path(__file__).resolve().parent
_SCRIPTS = _ROOT / "scripts"
sys.path.insert(0, str(_SCRIPTS))
os.chdir(_ROOT)
# Loopback probes (Gradio / httpx); harmless on Space.
os.environ.setdefault("NO_PROXY", "localhost,127.0.0.1,::1")
SPACE_ENCODER_ID = "HyperlinksSpace/TinyModel1"
PUBLIC_APP_URL = "https://hyperlinksspace-tinymodel1space.hf.space"
MODEL_HUB_URL = "https://huggingface.co/HyperlinksSpace/TinyModel1"
GITHUB_REPO_URL = "https://github.com/HyperlinksSpace/TinyModel"
SPACE_NAME = "TinyModel1Space"
def main() -> None:
port = int(os.environ.get("PORT", "7860"))
argv = [
"universal_brain_chat.py",
"--host",
"0.0.0.0",
"--port",
str(port),
"--encoder",
SPACE_ENCODER_ID,
]
gen = os.environ.get("HORIZON2_MODEL", "").strip()
if gen:
argv.extend(["--model", gen])
sys.argv = argv
from universal_brain_chat import main as ub_main
ub_main()
if __name__ == "__main__":
main()
|