Download code/run_all.sh from Ami1ne/wan1.3b-bora-quant: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/Ami1ne/wan1.3b-bora-quant/resolve/main/code/run_all.sh
- Command line
-
hf download hf://Ami1ne/wan1.3b-bora-quant/code/run_all.sh
-
curl -L -o run_all.sh https://huggingface.co/Ami1ne/wan1.3b-bora-quant/resolve/main/code/run_all.sh
1.29 kB
| # Start a persistent kernel, then run the whole notebook through it: cells 1-9, pick the fine-tune variant, cells 10-12. | |
| cd /ephemeral/wq | |
| source venv/bin/activate | |
| export HF_HOME=/ephemeral/hf HF_HUB_DISABLE_XET=1 HF_TOKEN="$(cat /ephemeral/hf/token)" | |
| if ! tmux has-session -t kernel 2>/dev/null; then | |
| tmux new-session -d -s kernel "bash -c 'cd /ephemeral/wq && source venv/bin/activate && export HF_HOME=/ephemeral/hf HF_HUB_DISABLE_XET=1 HF_TOKEN=\"\$(cat /ephemeral/hf/token)\" && python -m ipykernel_launcher -f /ephemeral/wq/kernel.json 2>&1 | tee kernel.log'" | |
| for i in $(seq 1 30); do [ -f kernel.json ] && break; sleep 2; done | |
| sleep 5 | |
| fi | |
| D="python nbdrive.py kernel.json wan_quant.ipynb wan_quant_executed.ipynb" | |
| CHOOSE='_r = [r for r in RESULTS if r.get("bits") == 3 and r.get("group") == 128 and not r.get("finetuned")] | |
| _b = min(_r, key=lambda r: r["val_loss"]) | |
| FT_VARIANT = (_b["method"], 3, 128) | |
| print("FT_VARIANT ->", FT_VARIANT, "| W3 g128 val losses:", {r["method"]: round(r["val_loss"], 4) for r in _r})' | |
| FROM=${1:-1} | |
| set -o pipefail | |
| { | |
| if [ "$FROM" -le 9 ]; then $D "$FROM-9" || exit 1; fi | |
| if [ "$FROM" -le 10 ]; then $D "code:$CHOOSE" || exit 1; $D 10-12 || exit 1 | |
| else $D "$FROM-12" || exit 1; fi | |
| } 2>&1 | tee -a run.log | |
| echo "RUN_EXIT=$?" >> run.log | |