Merge pull request #3 from junaire/jun/rename #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_LOG: DEBUG | |
RUST_BACKTRACE: full | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build SDK | |
run: | | |
rustup target add wasm32-wasi | |
cd example | |
cargo build --target wasm32-wasi --release | |
- name: Download data | |
run: | | |
wget -P /tmp/data/ https://huggingface.co/datasets/karpathy/llmc-starter-pack/resolve/main/gpt2_124M.bin | |
wget -P /tmp/data/ https://huggingface.co/datasets/karpathy/llmc-starter-pack/resolve/main/tiny_shakespeare_train.bin | |
wget -P /tmp/data/ https://huggingface.co/datasets/karpathy/llmc-starter-pack/resolve/main/tiny_shakespeare_val.bin | |
wget -P /tmp/data/ https://huggingface.co/datasets/karpathy/llmc-starter-pack/resolve/main/gpt2_tokenizer.bin | |
- name: Build WasmEdge | |
run: | | |
sudo apt update && sudo apt install software-properties-common | |
git clone https://github.com/WasmEdge/WasmEdge /tmp/WasmEdge | |
mkdir /tmp/build && cd /tmp/build | |
cmake /tmp/WasmEdge -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_USE_LLVM=OFF -DWASMEDGE_PLUGIN_LLMC=ON -DWASMEDGE_BUILD_TESTS=OFF | |
make -j$(nproc) && sudo make install | |
- name: Train GPT2 | |
run: | | |
WASMEDGE_PLUGIN_PATH=/usr/local/lib/wasmedge/ wasmedge --dir .:. ./example/target/wasm32-wasi/release/example.wasm |