Buckets:
| set -euo pipefail | |
| echo "=== Installing build dependencies ===" | |
| apt-get update && apt-get install -y cmake git curl build-essential pkg-config libssl-dev python3-pip python3-venv | |
| echo "=== Installing Rust ===" | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| source /root/.cargo/env | |
| echo "=== Extracting source ===" | |
| mkdir -p /tmp/llama-stage-runtime | |
| tar xzf /bucket/source.tar.gz -C /tmp/llama-stage-runtime | |
| cd /tmp/llama-stage-runtime | |
| echo "=== Preparing llama.cpp ===" | |
| sed -i 's/--filter=blob:none //' scripts/prepare-llama.sh | |
| scripts/prepare-llama.sh pinned | |
| echo "=== Building llama.cpp ===" | |
| scripts/build-llama.sh | |
| echo "=== Building llama-model-slice ===" | |
| LLAMA_STAGE_LLAMA_BUILD_DIR=.deps/llama.cpp/build-stage-abi-static \ | |
| cargo build --release -p llama-model-slice | |
| echo "=== Splitting model ===" | |
| SOURCE_PATH="/source/UD-Q4_K_XL/Qwen3-235B-A22B-UD-Q4_K_XL-00001-of-00003.gguf" | |
| PACKAGE_DIR="/tmp/package" | |
| mkdir -p "$PACKAGE_DIR" | |
| target/release/llama-model-slice write-package "$SOURCE_PATH" \ | |
| --out-dir "$PACKAGE_DIR" \ | |
| --model-id "unsloth/Qwen3-235B-A22B-GGUF:UD-Q4_K_XL" \ | |
| --source-repo "unsloth/Qwen3-235B-A22B-GGUF" \ | |
| --source-revision "main" \ | |
| --source-file "UD-Q4_K_XL/Qwen3-235B-A22B-UD-Q4_K_XL-00001-of-00003.gguf" | |
| echo "=== Validating package ===" | |
| target/release/llama-model-slice validate-package "$SOURCE_PATH" "$PACKAGE_DIR" | |
| echo "=== Package contents ===" | |
| ls -lh "$PACKAGE_DIR"/shared/ | |
| echo "Layer files:" | |
| ls "$PACKAGE_DIR"/layers/ | wc -l | |
| ls -lh "$PACKAGE_DIR"/layers/ | head -5 | |
| echo "..." | |
| ls -lh "$PACKAGE_DIR"/layers/ | tail -3 | |
| echo "=== Publishing to HF ===" | |
| python3 -m venv /tmp/venv | |
| /tmp/venv/bin/pip install huggingface_hub | |
| /tmp/venv/bin/python3 -c " | |
| from huggingface_hub import HfApi | |
| import os | |
| api = HfApi(token=os.environ['HF_TOKEN']) | |
| target_repo = 'meshllm/Qwen3-235B-A22B-UD-Q4_K_XL-layers' | |
| api.create_repo(target_repo, exist_ok=True) | |
| api.upload_folder( | |
| repo_id=target_repo, | |
| folder_path='/tmp/package', | |
| commit_message='Layer package from unsloth/Qwen3-235B-A22B-GGUF UD-Q4_K_XL', | |
| ) | |
| print(f'Published: https://huggingface.co/{target_repo}') | |
| " | |
| echo "=== DONE ===" | |
Xet Storage Details
- Size:
- 2.16 kB
- Xet hash:
- 86e91b0a2dbbb79435a4881f846b58907645acd2282b1f1d07542b5277975e00
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.