|
31 | 31 | cd wasmedge-ggml/llama |
32 | 32 | curl -LO https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF/resolve/main/tinyllama-1.1b-chat-v0.3.Q5_K_M.gguf |
33 | 33 | cargo build --target wasm32-wasi --release |
34 | | - wasmedge --dir .:. \ |
| 34 | + time wasmedge --dir .:. \ |
35 | 35 | --nn-preload default:GGML:AUTO:tinyllama-1.1b-chat-v0.3.Q5_K_M.gguf \ |
36 | 36 | target/wasm32-wasi/release/wasmedge-ggml-llama.wasm \ |
37 | 37 | default \ |
|
42 | 42 | cd wasmedge-ggml/gemma |
43 | 43 | curl -LO https://huggingface.co/second-state/Gemma-2b-it-GGUF/resolve/main/gemma-2b-it-Q5_K_M.gguf |
44 | 44 | cargo build --target wasm32-wasi --release |
45 | | - wasmedge --dir .:. \ |
| 45 | + time wasmedge --dir .:. \ |
46 | 46 | --env n_gpu_layers=0 \ |
47 | 47 | --nn-preload default:GGML:AUTO:gemma-2b-it-Q5_K_M.gguf \ |
48 | 48 | target/wasm32-wasi/release/wasmedge-ggml-gemma.wasm \ |
|
56 | 56 | curl -LO https://huggingface.co/mys/ggml_llava-v1.5-7b/resolve/main/mmproj-model-f16.gguf |
57 | 57 | curl -LO https://llava-vl.github.io/static/images/monalisa.jpg |
58 | 58 | cargo build --target wasm32-wasi --release |
59 | | - wasmedge --dir .:. \ |
| 59 | + time wasmedge --dir .:. \ |
60 | 60 | --env mmproj=mmproj-model-f16.gguf \ |
61 | 61 | --env image=monalisa.jpg \ |
62 | 62 | --env n_gpu_layers=0 \ |
|
72 | 72 | curl -LO https://huggingface.co/cmp-nct/llava-1.6-gguf/resolve/main/mmproj-vicuna7b-f16.gguf |
73 | 73 | curl -LO https://llava-vl.github.io/static/images/monalisa.jpg |
74 | 74 | cargo build --target wasm32-wasi --release |
75 | | - wasmedge --dir .:. \ |
| 75 | + time wasmedge --dir .:. \ |
76 | 76 | --env mmproj=mmproj-vicuna7b-f16.gguf \ |
77 | 77 | --env image=monalisa.jpg \ |
78 | 78 | --env ctx_size=4096 \ |
|
87 | 87 | cd wasmedge-ggml/llama |
88 | 88 | curl -LO https://huggingface.co/TheBloke/Llama-2-7b-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_M.gguf |
89 | 89 | cargo build --target wasm32-wasi --release |
90 | | - wasmedge --dir .:. \ |
| 90 | + time wasmedge --dir .:. \ |
91 | 91 | --nn-preload default:GGML:AUTO:llama-2-7b-chat.Q5_K_M.gguf \ |
92 | 92 | target/wasm32-wasi/release/wasmedge-ggml-llama.wasm \ |
93 | 93 | default \ |
@@ -125,3 +125,99 @@ jobs: |
125 | 125 | - name: ${{ matrix.job.name }} |
126 | 126 | run: ${{ matrix.job.run }} |
127 | 127 |
|
| 128 | + m1: |
| 129 | + strategy: |
| 130 | + matrix: |
| 131 | + runner: [macos-m1] |
| 132 | + job: |
| 133 | + - name: "Tiny Llama" |
| 134 | + run: | |
| 135 | + source ~/.wasmedge/env |
| 136 | + cd wasmedge-ggml/llama |
| 137 | + curl -LO https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF/resolve/main/tinyllama-1.1b-chat-v0.3.Q5_K_M.gguf |
| 138 | + cargo build --target wasm32-wasi --release |
| 139 | + time wasmedge --dir .:. \ |
| 140 | + --nn-preload default:GGML:AUTO:tinyllama-1.1b-chat-v0.3.Q5_K_M.gguf \ |
| 141 | + --env n_gpu_layers=100 \ |
| 142 | + target/wasm32-wasi/release/wasmedge-ggml-llama.wasm \ |
| 143 | + default \ |
| 144 | + $'<|im_start|>system\nYou are an AI assistant<|im_end|>\n<|im_start|>user\nWhere is the capital of Japan?<|im_end|>\n<|im_start|>assistant' |
| 145 | +
|
| 146 | + - name: Gemma 2B |
| 147 | + run: | |
| 148 | + source ~/.wasmedge/env |
| 149 | + cd wasmedge-ggml/gemma |
| 150 | + curl -LO https://huggingface.co/second-state/Gemma-2b-it-GGUF/resolve/main/gemma-2b-it-Q5_K_M.gguf |
| 151 | + cargo build --target wasm32-wasi --release |
| 152 | + time wasmedge --dir .:. \ |
| 153 | + --env n_gpu_layers=100 \ |
| 154 | + --nn-preload default:GGML:AUTO:gemma-2b-it-Q5_K_M.gguf \ |
| 155 | + target/wasm32-wasi/release/wasmedge-ggml-gemma.wasm \ |
| 156 | + default \ |
| 157 | + '<start_of_turn>user Where is the capital of Japan? <end_of_turn><start_of_turn>model' |
| 158 | +
|
| 159 | + - name: Llava v1.5 7B |
| 160 | + run: | |
| 161 | + source ~/.wasmedge/env |
| 162 | + cd wasmedge-ggml/llava |
| 163 | + curl -LO https://huggingface.co/mys/ggml_llava-v1.5-7b/resolve/main/ggml-model-q5_k.gguf |
| 164 | + curl -LO https://huggingface.co/mys/ggml_llava-v1.5-7b/resolve/main/mmproj-model-f16.gguf |
| 165 | + curl -LO https://llava-vl.github.io/static/images/monalisa.jpg |
| 166 | + cargo build --target wasm32-wasi --release |
| 167 | + time wasmedge --dir .:. \ |
| 168 | + --env mmproj=mmproj-model-f16.gguf \ |
| 169 | + --env image=monalisa.jpg \ |
| 170 | + --env ctx_size=2048 \ |
| 171 | + --env n_gpu_layers=100 \ |
| 172 | + --nn-preload default:GGML:AUTO:ggml-model-q5_k.gguf \ |
| 173 | + target/wasm32-wasi/release/wasmedge-ggml-llava.wasm \ |
| 174 | + default \ |
| 175 | + $'You are a helpful, respectful and honest assistant. Always answer as short as possible, while being safe.\nUSER:<image>\nDo you know who drew this painting?\nASSISTANT:' |
| 176 | +
|
| 177 | + - name: Llava v1.6 7B |
| 178 | + run: | |
| 179 | + source ~/.wasmedge/env |
| 180 | + cd wasmedge-ggml/llava |
| 181 | + curl -LO https://huggingface.co/cmp-nct/llava-1.6-gguf/resolve/main/vicuna-7b-q5_k.gguf |
| 182 | + curl -LO https://huggingface.co/cmp-nct/llava-1.6-gguf/resolve/main/mmproj-vicuna7b-f16.gguf |
| 183 | + curl -LO https://llava-vl.github.io/static/images/monalisa.jpg |
| 184 | + cargo build --target wasm32-wasi --release |
| 185 | + time wasmedge --dir .:. \ |
| 186 | + --env mmproj=mmproj-vicuna7b-f16.gguf \ |
| 187 | + --env image=monalisa.jpg \ |
| 188 | + --env ctx_size=4096 \ |
| 189 | + --env n_gpu_layers=100 \ |
| 190 | + --nn-preload default:GGML:AUTO:vicuna-7b-q5_k.gguf \ |
| 191 | + target/wasm32-wasi/release/wasmedge-ggml-llava.wasm \ |
| 192 | + default \ |
| 193 | + $'You are a helpful, respectful and honest assistant. Always answer as short as possible, while being safe.\nUSER:<image>\nDo you know who drew this painting?\nASSISTANT:' |
| 194 | +
|
| 195 | + - name: Llama2 7B |
| 196 | + run: | |
| 197 | + source ~/.wasmedge/env |
| 198 | + cd wasmedge-ggml/llama |
| 199 | + curl -LO https://huggingface.co/TheBloke/Llama-2-7b-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_M.gguf |
| 200 | + cargo build --target wasm32-wasi --release |
| 201 | + time wasmedge --dir .:. \ |
| 202 | + --nn-preload default:GGML:AUTO:llama-2-7b-chat.Q5_K_M.gguf \ |
| 203 | + --env n_gpu_layers=100 \ |
| 204 | + target/wasm32-wasi/release/wasmedge-ggml-llama.wasm \ |
| 205 | + default \ |
| 206 | + $'[INST] <<SYS>>\nYou are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you do not know the answer to a question, please do not share false information.\n<</SYS>>\nWhat is the capital of Japan?[/INST]' |
| 207 | +
|
| 208 | + name: ${{ matrix.runner }} - ${{ matrix.job.name }} |
| 209 | + runs-on: ${{ matrix.runner }} |
| 210 | + steps: |
| 211 | + - uses: actions/checkout@v4 |
| 212 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 213 | + - name: Install Rust target for wasm |
| 214 | + run: | |
| 215 | + rustup target add wasm32-wasi |
| 216 | +
|
| 217 | + - name: Install WasmEdge + WASI-NN + GGML |
| 218 | + run: | |
| 219 | + VERSION=0.13.5 |
| 220 | + curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $VERSION --plugins wasi_nn-ggml |
| 221 | +
|
| 222 | + - name: ${{ matrix.job.name }} |
| 223 | + run: ${{ matrix.job.run }} |
0 commit comments