Upload folder using huggingface_hub
Browse files- code/vast_bootstrap.sh +29 -18
code/vast_bootstrap.sh
CHANGED
|
@@ -43,31 +43,42 @@ done
|
|
| 43 |
echo "building venv from $PYBIN ($($PYBIN -V 2>&1))"
|
| 44 |
"$PYBIN" -m venv /opt/venv
|
| 45 |
/opt/venv/bin/pip install -q --upgrade pip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# kociemba's setup.py predates modern setuptools' removal of install_layout.
|
| 47 |
/opt/venv/bin/pip install -q "setuptools<60" wheel
|
| 48 |
# Full output, not a tail: when the C extension fails to build, kociemba still
|
| 49 |
# installs successfully (as pure Python), so the compiler error is the only
|
| 50 |
# evidence of what went wrong and it must not be truncated away.
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
#
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
| 60 |
|
| 61 |
-
if ! /opt/venv/bin/python -c "import kociemba.ckociembawrapper" 2>/dev/null; then
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
| 70 |
fi
|
|
|
|
| 71 |
/opt/venv/bin/pip install -q torch --index-url https://download.pytorch.org/whl/cu128
|
| 72 |
/opt/venv/bin/pip install -q transformers huggingface_hub
|
| 73 |
|
|
|
|
| 43 |
echo "building venv from $PYBIN ($($PYBIN -V 2>&1))"
|
| 44 |
"$PYBIN" -m venv /opt/venv
|
| 45 |
/opt/venv/bin/pip install -q --upgrade pip
|
| 46 |
+
# kociemba is only needed to LABEL data. The eval and value-iteration modes need
|
| 47 |
+
# neither: value iteration bootstraps its own targets, and the search evaluator
|
| 48 |
+
# only ever applies moves. Building it anyway costs ~20 minutes of metered time,
|
| 49 |
+
# because a failed C-extension build falls back to an upstream-git rebuild --
|
| 50 |
+
# observed on a run that then never imported the module at all.
|
| 51 |
+
NEEDS_SOLVER=1
|
| 52 |
+
if [ -n "${EVAL_VALUE_ONLY:-}${TRAIN_VALUE_ITER:-}" ]; then NEEDS_SOLVER=""; fi
|
| 53 |
+
|
| 54 |
# kociemba's setup.py predates modern setuptools' removal of install_layout.
|
| 55 |
/opt/venv/bin/pip install -q "setuptools<60" wheel
|
| 56 |
# Full output, not a tail: when the C extension fails to build, kociemba still
|
| 57 |
# installs successfully (as pure Python), so the compiler error is the only
|
| 58 |
# evidence of what went wrong and it must not be truncated away.
|
| 59 |
+
if [ -n "$NEEDS_SOLVER" ]; then
|
| 60 |
+
/opt/venv/bin/pip install --no-build-isolation kociemba 2>&1 | tail -40
|
| 61 |
+
|
| 62 |
+
# Last resort before giving up: build from the upstream git source, whose build
|
| 63 |
+
# metadata is newer than the 2017 PyPI sdist.
|
| 64 |
+
if ! /opt/venv/bin/python -c "import kociemba.ckociembawrapper" 2>/dev/null; then
|
| 65 |
+
echo "=== sdist build produced no extension; trying upstream git ==="
|
| 66 |
+
/opt/venv/bin/pip install --force-reinstall --no-build-isolation \
|
| 67 |
+
"git+https://github.com/muodov/kociemba.git" 2>&1 | tail -15 || true
|
| 68 |
+
fi
|
| 69 |
|
| 70 |
+
if ! /opt/venv/bin/python -c "import kociemba.ckociembawrapper" 2>/dev/null; then
|
| 71 |
+
echo "=== NATIVE BUILD FAILED -- diagnostics ==="
|
| 72 |
+
echo "python: $(/opt/venv/bin/python -V 2>&1) at $(/opt/venv/bin/python -c 'import sys;print(sys.executable)')"
|
| 73 |
+
echo "gcc: $(gcc --version 2>&1 | head -1)"
|
| 74 |
+
echo "includes: $(/opt/venv/bin/python -c 'import sysconfig;print(sysconfig.get_paths()["include"])')"
|
| 75 |
+
ls -l "$(/opt/venv/bin/python -c 'import sysconfig;print(sysconfig.get_paths()["include"])')/Python.h" 2>&1 || echo " Python.h MISSING"
|
| 76 |
+
dpkg -l | grep -E "python3.*dev|build-essential" || echo " no dev packages found"
|
| 77 |
+
echo "=== retrying verbosely ==="
|
| 78 |
+
/opt/venv/bin/pip install --force-reinstall --no-build-isolation -v kociemba 2>&1 | grep -iE "error|gcc|Python.h|fatal" | head -30
|
| 79 |
+
fi
|
| 80 |
fi
|
| 81 |
+
|
| 82 |
/opt/venv/bin/pip install -q torch --index-url https://download.pytorch.org/whl/cu128
|
| 83 |
/opt/venv/bin/pip install -q transformers huggingface_hub
|
| 84 |
|