Views
No views yet
1print("📦 Installing dependencies...")
2!pip install -q huggingface_hub
3
4import os
5import tarfile
6from huggingface_hub import hf_hub_download
7
8HF_REPO = "IamPradeep/Bonsai-8B-1bit-GGUF-Colab-Pre-built"
9print("\n📥 1/3 Downloading pre-built llama.cpp (Fast)...")
10
11llama_zip = hf_hub_download(repo_id=HF_REPO, filename="llama_cpp_prebuilt.tar.gz")
12print("📥 2/3 Downloading Bonsai-8B.gguf model (Large file)...")
13
14model_path = hf_hub_download(repo_id=HF_REPO, filename="Bonsai-8B.gguf")
15print("📦 3/3 Extracting files...")
16
17!mkdir -p /content/llama.cpp
18with tarfile.open(llama_zip, "r:gz") as tar:
19 tar.extractall(path="/content/llama.cpp")
20!chmod +x /content/llama.cpp/build/bin/llama-cli
21print("\n🎉 Setup complete!")1USER_PROMPT = "Explain quantum computing in simple terms."
2SYSTEM_PROMPT = "You are a helpful assistant"
3!/content/llama.cpp/build/bin/llama-cli \
4 -m "{model_path}" \
5 --system-prompt "{SYSTEM_PROMPT}" \
6 -p "{USER_PROMPT}" \
7 -n 4096 \
8 --temp 0.5 \
9 --top-p 0.85 \
10 --top-k 20 \
11 -ngl 99