Download tasks/binary-edit-lower/environment/fetch_mathlib.sh from FineEnvs/openai-math: direct link, hf CLI and curl.
- Browser
- Download file 744 Bytes
-
https://huggingface.co/datasets/FineEnvs/openai-math/resolve/main/tasks/binary-edit-lower/environment/fetch_mathlib.sh
- Command line
-
hf download hf://datasets/FineEnvs/openai-math/tasks/binary-edit-lower/environment/fetch_mathlib.sh
-
curl -L -o fetch_mathlib.sh https://huggingface.co/datasets/FineEnvs/openai-math/resolve/main/tasks/binary-edit-lower/environment/fetch_mathlib.sh
744 Bytes
| # Unpack Mathlib's prebuilt cache in batches and truncate the files that importing Mathlib never | |
| # reads (generated C and .ilean editor indexes), keeping their .hash files so Lake still sees every | |
| # module as built. Lean + full Mathlib otherwise needs ~11 GB, more than a 10 GB sandbox disk. | |
| set -euo pipefail | |
| cd /opt/lean-env | |
| trim() { | |
| find .lake/packages -path '*/.lake/build/*' \( -name '*.c' -o -name '*.ilean' \) -size +0 -exec truncate -s 0 {} + | |
| rm -rf "${HOME:-/root}/.cache/mathlib" | |
| } | |
| for dir in .lake/packages/mathlib/Mathlib/*/; do | |
| name=$(basename "$dir") | |
| echo "== Mathlib/$name" | |
| lake exe cache get ".lake/packages/mathlib/Mathlib/$name" >/dev/null | |
| trim | |
| df -h / | tail -1 | |
| done | |
| lake exe cache get | |
| trim | |