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)