安装
# 耐心等待
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- --plugin wasi_nn-ggml
# After install the wasmedge, you have to activate the environment.
# Assuming you use zsh (the default shell on macOS), you will need to run the following command
source $HOME/.zshenv
curl -LO https://github.com/second-state/WasmEdge-WASINN-examples/blob/master/wasmedge-ggml-llama-interactive/wasmedge-ggml-llama-interactive.wasm
# 文件大、下载慢、耐心等待
curl -LO https://huggingface.co/TheBloke/Llama-2-7b-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_M.gguf
启动
# 耐心等待
wasmedge --dir .:. \ --nn-preload default:GGML:CPU:llama-2-7b-chat.Q5_K_M.gguf \ wasmedge-ggml-llama-interactive.wasm default
当启动成功时,你会看到提示词“Question:“
使用
输入任何你想提问的问题即可。
image.png