MrA7A1 commited on
Commit
3b68212
·
verified ·
1 Parent(s): ee3e4f2

KAPO rollout fix: sync bootstrap_space_runtime.py

Browse files
Files changed (1) hide show
  1. bootstrap_space_runtime.py +22 -37
bootstrap_space_runtime.py CHANGED
@@ -6,38 +6,28 @@ import sys
6
  from pathlib import Path
7
 
8
  DEFAULT_ENV = {
9
- "BRAIN_AUTO_NGROK": "0",
10
- "BRAIN_AUTO_PUBLISH_URL_ON_STARTUP": "0",
11
- "BRAIN_LANGUAGES": "ar,en",
12
- "BRAIN_PLATFORM_NAME": "ai_coder_main",
13
- "BRAIN_PROVIDER": "huggingface",
14
- "BRAIN_REUSE_PUBLIC_URL_ON_RESTART": "0",
15
- "BRAIN_ROLES": "coding,planner,fallback",
16
- "BRAIN_TEMPLATE": "hf-space-cpu",
17
- "BRAIN_TUNNEL_PROVIDER": "none",
18
- "FIREBASE_ENABLED": "0",
19
- "FIREBASE_NAMESPACE": "kapo",
20
- "FIREBASE_PROJECT_ID": "citadel4travels",
21
- "GOOGLE_DRIVE_BOOTSTRAP_URL": "https://drive.google.com/uc?export=download&id=19jyBWsQ9ciJVPi2PUigu5ti3gJ24A6TG",
22
- "HF_ACCELERATOR": "cpu",
23
- "HF_SPACE_DOCKER": "1",
24
- "KAGGLE_AUTO_BOOTSTRAP": "0",
25
- "KAPO_BOOTSTRAP_URL": "https://drive.google.com/uc?export=download&id=19jyBWsQ9ciJVPi2PUigu5ti3gJ24A6TG",
26
- "KAPO_COMPUTE_PROFILE": "cpu",
27
- "KAPO_DISABLE_EMBEDDINGS": "1",
28
- "KAPO_HF_INFERENCE_API": "0",
29
- "KAPO_HF_TRANSFORMERS_RUNTIME": "1",
30
- "KAPO_LAZY_EMBED_STARTUP": "1",
31
- "KAPO_LAZY_MODEL_STARTUP": "1",
32
- "KAPO_PATCH_BUNDLE_URL": "https://drive.google.com/uc?export=download&id=1PwpKBh_1pJ6syBihyCBHHDwypGRmUGQP",
33
- "KAPO_PATCH_MANIFEST_URL": "https://drive.google.com/uc?export=download&id=1kuzboReag0emMj-wU8pn64K4_Hvps_jy",
34
- "KAPO_REMOTE_ENV_PASSWORD_B64": "N09WNHY3bHdmVXptQy02VWljM1l1dFpnTzE2cnZ4clA",
35
- "KAPO_REMOTE_ENV_URL_B64": "aHR0cHM6Ly9kcml2ZS5nb29nbGUuY29tL3VjP2V4cG9ydD1kb3dubG9hZCZpZD0xYnRyelhReElHVThtWk9QSlljQ3RBWE1qdFBHaFpCazE",
36
- "KAPO_SHARED_STATE_BACKEND": "google_drive",
37
- "MODEL_PROFILE_ID": "hf-coder-qwen25-coder-7b-instruct",
38
- "MODEL_REPO": "Qwen/Qwen2.5-Coder-1.5B-Instruct",
39
- "REMOTE_BRAIN_ONLY": "1",
40
- "SPACE_PUBLIC_URL": "https://MrA7A1-AiCoderClean.hf.space"
41
  }
42
 
43
 
@@ -74,13 +64,8 @@ def main() -> None:
74
  for key, value in DEFAULT_ENV.items():
75
  os.environ.setdefault(str(key), str(value))
76
  space_host = str(os.getenv('SPACE_HOST', '')).strip().rstrip('/')
77
- space_id = str(os.getenv('SPACE_ID', '')).strip()
78
- public_url = ''
79
  if space_host:
80
  public_url = space_host if space_host.startswith('http://') or space_host.startswith('https://') else f'https://{space_host}'
81
- elif space_id and '/' in space_id:
82
- public_url = 'https://' + space_id.replace('/', '-').lower() + '.hf.space'
83
- if public_url:
84
  os.environ['BRAIN_PUBLIC_URL'] = public_url.rstrip('/')
85
  runtime_root.mkdir(parents=True, exist_ok=True)
86
  overlay_root.mkdir(parents=True, exist_ok=True)
 
6
  from pathlib import Path
7
 
8
  DEFAULT_ENV = {
9
+ "REMOTE_BRAIN_ONLY": "1",
10
+ "KAGGLE_AUTO_BOOTSTRAP": "0",
11
+ "BRAIN_AUTO_NGROK": "0",
12
+ "BRAIN_AUTO_PUBLISH_URL_ON_STARTUP": "0",
13
+ "BRAIN_REUSE_PUBLIC_URL_ON_RESTART": "0",
14
+ "HF_SPACE_DOCKER": "1",
15
+ "KAPO_COMPUTE_PROFILE": "cpu",
16
+ "HF_ACCELERATOR": "cpu",
17
+ "KAPO_HF_TRANSFORMERS_RUNTIME": "1",
18
+ "KAPO_LAZY_MODEL_STARTUP": "1",
19
+ "KAPO_LAZY_EMBED_STARTUP": "1",
20
+ "MODEL_PROFILE_ID": "hf-debugger-qwen25-7b-instruct",
21
+ "MODEL_REPO": "Qwen/Qwen2.5-1.5B-Instruct",
22
+ "BRAIN_ROLES": "fallback",
23
+ "BRAIN_LANGUAGES": "ar,en",
24
+ "BRAIN_PLATFORM_NAME": "hf_debugger_main",
25
+ "BRAIN_TEMPLATE": "hf-space-cpu",
26
+ "BRAIN_PROVIDER": "huggingface",
27
+ "FIREBASE_ENABLED": "1",
28
+ "FIREBASE_PROJECT_ID": "citadel4travels",
29
+ "FIREBASE_NAMESPACE": "kapo",
30
+ "BRAIN_REUSE_PUBLIC_URL_ON_RESTART": "0",
 
 
 
 
 
 
 
 
 
 
31
  }
32
 
33
 
 
64
  for key, value in DEFAULT_ENV.items():
65
  os.environ.setdefault(str(key), str(value))
66
  space_host = str(os.getenv('SPACE_HOST', '')).strip().rstrip('/')
 
 
67
  if space_host:
68
  public_url = space_host if space_host.startswith('http://') or space_host.startswith('https://') else f'https://{space_host}'
 
 
 
69
  os.environ['BRAIN_PUBLIC_URL'] = public_url.rstrip('/')
70
  runtime_root.mkdir(parents=True, exist_ok=True)
71
  overlay_root.mkdir(parents=True, exist_ok=True)