import subprocess import os # Change directory to /content os.chdir("/content") # Remove the llama.cpp directory if it exists subprocess.run(["rm", "-rf", "llama.cpp"]) # Clone the llama.cpp repository subprocess.run(["git", "clone", "https://github.com/ggerganov/llama.cpp.git"]) # Change directory to llama.cpp os.chdir("llama.cpp") # Build the project with LLAMA_CUBLAS=1 subprocess.run(["make", "LLAMA_CUBLAS=1"]) # Download the zephyr-7b-beta model subprocess.run(["wget", "https://huggingface.co/TheBloke/zephyr-7B-beta-GGUF/resolve/main/zephyr-7b-beta.Q6_K.gguf"]) # Change directory to /content/llama.cpp os.chdir("/content/llama.cpp") # Run the server subprocess.run(["./server", "-m", "zephyr-7b-beta.Q6_K.gguf", "-ngl", "9999", "-c", "0", "--port", "12345"])