Spaces:
Paused
Paused
Arshit Malik commited on
Commit ·
72b329b
1
Parent(s): c31a625
fix: sync_hub syntax, openclaw password key, is_private bool, remove double logging, 14b model
Browse files- automation.py +2 -5
- start.sh +9 -16
- sync_hub.py +2 -2
automation.py
CHANGED
|
@@ -27,10 +27,7 @@ logging.basicConfig(
|
|
| 27 |
level=logging.INFO,
|
| 28 |
format="[%(asctime)s] %(message)s",
|
| 29 |
datefmt="%H:%M:%S",
|
| 30 |
-
handlers=[
|
| 31 |
-
logging.StreamHandler(sys.stdout),
|
| 32 |
-
logging.FileHandler(BASE_DIR / "pipeline.log", encoding="utf-8"),
|
| 33 |
-
]
|
| 34 |
)
|
| 35 |
log = logging.getLogger()
|
| 36 |
|
|
@@ -117,7 +114,7 @@ def push_kaggle_kernel(build_dir: Path, main_py_text: str, label: str):
|
|
| 117 |
"kernel_type": "script",
|
| 118 |
"enable_gpu": "true",
|
| 119 |
"enable_internet": "true",
|
| 120 |
-
"is_private":
|
| 121 |
}
|
| 122 |
(build_dir / "kernel-metadata.json").write_text(json.dumps(meta, indent=2))
|
| 123 |
set_kaggle_creds(acc)
|
|
|
|
| 27 |
level=logging.INFO,
|
| 28 |
format="[%(asctime)s] %(message)s",
|
| 29 |
datefmt="%H:%M:%S",
|
| 30 |
+
handlers=[logging.StreamHandler(sys.stdout)]
|
|
|
|
|
|
|
|
|
|
| 31 |
)
|
| 32 |
log = logging.getLogger()
|
| 33 |
|
|
|
|
| 114 |
"kernel_type": "script",
|
| 115 |
"enable_gpu": "true",
|
| 116 |
"enable_internet": "true",
|
| 117 |
+
"is_private": False
|
| 118 |
}
|
| 119 |
(build_dir / "kernel-metadata.json").write_text(json.dumps(meta, indent=2))
|
| 120 |
set_kaggle_creds(acc)
|
start.sh
CHANGED
|
@@ -39,7 +39,7 @@ PYEOF
|
|
| 39 |
|
| 40 |
echo "[boot] Pre-configuring OpenClaw with Ollama..."
|
| 41 |
mkdir -p ~/.openclaw
|
| 42 |
-
|
| 43 |
cat > ~/.openclaw/openclaw.json << JSONEOF
|
| 44 |
{
|
| 45 |
"models": {
|
|
@@ -50,8 +50,8 @@ cat > ~/.openclaw/openclaw.json << JSONEOF
|
|
| 50 |
"api": "openai-responses",
|
| 51 |
"models": [
|
| 52 |
{
|
| 53 |
-
"id": "qwen2.5-coder:
|
| 54 |
-
"name": "Qwen2.5-Coder
|
| 55 |
"contextWindow": 8192,
|
| 56 |
"maxTokens": 2048,
|
| 57 |
"cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0},
|
|
@@ -63,12 +63,12 @@ cat > ~/.openclaw/openclaw.json << JSONEOF
|
|
| 63 |
},
|
| 64 |
"agents": {
|
| 65 |
"defaults": {
|
| 66 |
-
"model": {"primary": "ollama/qwen2.5-coder:
|
| 67 |
}
|
| 68 |
},
|
| 69 |
"gateway": {
|
| 70 |
"port": 8080,
|
| 71 |
-
"
|
| 72 |
}
|
| 73 |
}
|
| 74 |
JSONEOF
|
|
@@ -79,7 +79,6 @@ nginx
|
|
| 79 |
|
| 80 |
echo "[boot] Starting Ollama service..."
|
| 81 |
OLLAMA_HOST=127.0.0.1 ollama serve &
|
| 82 |
-
OLLAMA_PID=$!
|
| 83 |
|
| 84 |
echo "[boot] Waiting for Ollama to be ready..."
|
| 85 |
for i in $(seq 1 60); do
|
|
@@ -90,20 +89,14 @@ for i in $(seq 1 60); do
|
|
| 90 |
sleep 2
|
| 91 |
done
|
| 92 |
|
| 93 |
-
echo "[boot] Pulling qwen2.5-coder:
|
| 94 |
-
ollama pull qwen2.5-coder:
|
| 95 |
|
| 96 |
echo "[boot] Starting automation pipeline..."
|
| 97 |
python3 /app/automation.py >> /app/pipeline.log 2>&1 &
|
| 98 |
-
|
| 99 |
-
echo "[boot] Pipeline PID: $PIPE_PID"
|
| 100 |
|
| 101 |
echo "[boot] Starting OpenClaw gateway on port 8080..."
|
| 102 |
export OPENCLAW_API_PORT=8080
|
| 103 |
export OLLAMA_HOST=http://127.0.0.1:11434
|
| 104 |
-
openclaw gateway start
|
| 105 |
-
GW_PID=$!
|
| 106 |
-
|
| 107 |
-
echo "[boot] All services started. Tailing pipeline log..."
|
| 108 |
-
sleep 5
|
| 109 |
-
tail -f /app/pipeline.log
|
|
|
|
| 39 |
|
| 40 |
echo "[boot] Pre-configuring OpenClaw with Ollama..."
|
| 41 |
mkdir -p ~/.openclaw
|
| 42 |
+
GATEWAY_PASS="${OPENCLAW_PASSWORD:-arshit2025}"
|
| 43 |
cat > ~/.openclaw/openclaw.json << JSONEOF
|
| 44 |
{
|
| 45 |
"models": {
|
|
|
|
| 50 |
"api": "openai-responses",
|
| 51 |
"models": [
|
| 52 |
{
|
| 53 |
+
"id": "qwen2.5-coder:14b-instruct-q4_K_M",
|
| 54 |
+
"name": "Qwen2.5-Coder 14B (local CPU)",
|
| 55 |
"contextWindow": 8192,
|
| 56 |
"maxTokens": 2048,
|
| 57 |
"cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0},
|
|
|
|
| 63 |
},
|
| 64 |
"agents": {
|
| 65 |
"defaults": {
|
| 66 |
+
"model": {"primary": "ollama/qwen2.5-coder:14b-instruct-q4_K_M"}
|
| 67 |
}
|
| 68 |
},
|
| 69 |
"gateway": {
|
| 70 |
"port": 8080,
|
| 71 |
+
"password": "$GATEWAY_PASS"
|
| 72 |
}
|
| 73 |
}
|
| 74 |
JSONEOF
|
|
|
|
| 79 |
|
| 80 |
echo "[boot] Starting Ollama service..."
|
| 81 |
OLLAMA_HOST=127.0.0.1 ollama serve &
|
|
|
|
| 82 |
|
| 83 |
echo "[boot] Waiting for Ollama to be ready..."
|
| 84 |
for i in $(seq 1 60); do
|
|
|
|
| 89 |
sleep 2
|
| 90 |
done
|
| 91 |
|
| 92 |
+
echo "[boot] Pulling qwen2.5-coder:14b-instruct-q4_K_M (~8.7 GB, first boot only)..."
|
| 93 |
+
ollama pull qwen2.5-coder:14b-instruct-q4_K_M
|
| 94 |
|
| 95 |
echo "[boot] Starting automation pipeline..."
|
| 96 |
python3 /app/automation.py >> /app/pipeline.log 2>&1 &
|
| 97 |
+
echo "[boot] Pipeline PID: $!"
|
|
|
|
| 98 |
|
| 99 |
echo "[boot] Starting OpenClaw gateway on port 8080..."
|
| 100 |
export OPENCLAW_API_PORT=8080
|
| 101 |
export OLLAMA_HOST=http://127.0.0.1:11434
|
| 102 |
+
openclaw gateway start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sync_hub.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import os
|
| 2 |
from pathlib import Path
|
| 3 |
|
| 4 |
-
HF_TOKEN = os.environ.get("HF_TOKEN", "
|
| 5 |
DATASET_REPO = os.environ.get("OPENCLAW_DATASET_REPO", "")
|
| 6 |
|
| 7 |
PERSISTENT_FILES = {"topic_history.json", "fact_history.json", "token.pickle"}
|
|
@@ -16,7 +16,7 @@ def _get_api():
|
|
| 16 |
|
| 17 |
def pull_state(base_dir: Path):
|
| 18 |
if not DATASET_REPO or not HF_TOKEN:
|
| 19 |
-
print("OPENCLAW_DATASET_REPO not set, skipping
|
| 20 |
from huggingface_hub import hf_hub_download
|
| 21 |
from huggingface_hub.utils import EntryNotFoundError, RepositoryNotFoundError
|
| 22 |
print(f"Pulling state from {DATASET_REPO}...")
|
|
|
|
| 1 |
import os
|
| 2 |
from pathlib import Path
|
| 3 |
|
| 4 |
+
HF_TOKEN = os.environ.get("HF_TOKEN", "")
|
| 5 |
DATASET_REPO = os.environ.get("OPENCLAW_DATASET_REPO", "")
|
| 6 |
|
| 7 |
PERSISTENT_FILES = {"topic_history.json", "fact_history.json", "token.pickle"}
|
|
|
|
| 16 |
|
| 17 |
def pull_state(base_dir: Path):
|
| 18 |
if not DATASET_REPO or not HF_TOKEN:
|
| 19 |
+
print("OPENCLAW_DATASET_REPO or HF_TOKEN not set, skipping pull"); return
|
| 20 |
from huggingface_hub import hf_hub_download
|
| 21 |
from huggingface_hub.utils import EntryNotFoundError, RepositoryNotFoundError
|
| 22 |
print(f"Pulling state from {DATASET_REPO}...")
|