This is a dirty demo in wasm of llama2.c, you can run the demo localy.
This demo relies on notables implementation higlighted in here under notable forks
->rust
section.
- Download the release tarball and untar it.
- Run
python3 -m http.server 8080
inwww
folder. - Open
http://127.0.0.1:8080/
in your browser.
or
- run
wasm-pack build --release --target web --out-dir www/pkg/ --verbose
- download models :
mkdir -p stories/
wget -P stories/ https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin
wget -P stories/ https://huggingface.co/karpathy/tinyllamas/resolve/main/stories42M.bin
wget -P stories/ https://huggingface.co/karpathy/tinyllamas/resolve/main/stories110M.bin
for i in $(ls -d port*/www/)
do
cd $i
ln -s ../../stories/stories15M.bin .
ln -s ../../stories/stories42M.bin .
ln -s ../../stories/stories110M.bin .
done
- Run
python3 -m http.server 8080
inwww
folder. - Open
http://127.0.0.1:8080/
in your browser.
or
check it out live demo
- Port1 A dirty and minimal port of @Gaxler llama2.rs.
- Port2 A dirty and minimal port of @Leo-du llama2.rs.
- Port3 A dirty and minimal port of @danielgrittner llama2-rs.
- Port4 A dirty and minimal port of @lintian06 llama2.rs.
- Port5 A dirty and minimal port of @rahoua pecca.rs.
- Port6 A dirty and minimal port of @flaneur2020 llama2.rs.