Download code/finalize.sh from Redhanuman/pocket-storyteller: direct link, hf CLI and curl.
- Browser
- Download file 728 Bytes
-
https://huggingface.co/Redhanuman/pocket-storyteller/resolve/main/code/finalize.sh
- Command line
-
hf download hf://Redhanuman/pocket-storyteller/code/finalize.sh
-
curl -L -o finalize.sh https://huggingface.co/Redhanuman/pocket-storyteller/resolve/main/code/finalize.sh
728 Bytes
| # Pack a trained checkpoint, measure it, check it, and build the demo files. | |
| # bash finalize.sh uses ckpt.pt | |
| # bash finalize.sh other.pt uses another checkpoint | |
| set -e | |
| cd "$(dirname "$0")" | |
| CK=${1:-ckpt.pt} | |
| python3 export.py "$CK" data/tok4096.json web/storyteller.bin | |
| python3 tests/bigval.py "$CK" web/storyteller.bin | tee bigval.txt | |
| VAL=$(awk '/^packed/{print $2}' bigval.txt) | |
| python3 export.py "$CK" data/tok4096.json web/storyteller.bin --val-loss "$VAL" # same bytes, with the measured loss noted in the header | |
| python3 tests/check_export.py web/storyteller.bin "$CK" | |
| node tests/check_engine.js web/storyteller.bin | |
| base64 -w0 web/storyteller.bin > web/storyteller.b64.txt | |
| python3 build.py | |