Spaces:
Build error
Build error
Download app.py from joeng2004/manningLab: direct link, hf CLI and curl.
- Browser
- Download file 881 Bytes
-
https://huggingface.co/spaces/joeng2004/manningLab/resolve/main/app.py
- Command line
-
hf download hf://spaces/joeng2004/manningLab/app.py
-
curl -L -o app.py https://huggingface.co/spaces/joeng2004/manningLab/resolve/main/app.py
881 Bytes
| import os | |
| # download the model files | |
| download_files = """ | |
| wget https://github.com/LlamaEdge/LlamaEdge/releases/latest/download/llama-simple.wasm -O llama-simple.wasm && | |
| wget https://huggingface.co/hoorang/Llama-3.1-8B-Instruct-Q5_K_M-GGUF/raw/main/llama-3.1-8b-instruct-q5_k_m.gguf -O Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf | |
| """ | |
| os.system(download_files) | |
| # Install WasmEdge | |
| install_command = """ | |
| wget https://github.com/WasmEdge/WasmEdge/releases/download/0.12.1/WasmEdge-0.12.1-Linux.tar.gz && | |
| tar -xvzf WasmEdge-0.12.1-Linux.tar.gz && | |
| sudo cp WasmEdge-0.12.1-Linux/bin/* /usr/local/bin/ | |
| """ | |
| os.system(install_command) | |
| # Run the WasmEdge command | |
| command = "wasmedge --dir .:. --nn-preload default:GGML:AUTO:Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf llama-simple.wasm --n-predict 128 --log-enable --prompt 'Robert Oppenheimer's most important achievement is '" | |
| os.system(command) | |