Instructions to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="rozek/LLaMA-2-7B-32K-Instruct_GGUF", filename="LLaMA-2-7B-32K-Instruct-Q2_K.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
Use Docker
docker model run hf.co/rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rozek/LLaMA-2-7B-32K-Instruct_GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rozek/LLaMA-2-7B-32K-Instruct_GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
- Ollama
How to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with Ollama:
ollama run hf.co/rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
- Unsloth Studio new
How to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rozek/LLaMA-2-7B-32K-Instruct_GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for rozek/LLaMA-2-7B-32K-Instruct_GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for rozek/LLaMA-2-7B-32K-Instruct_GGUF to start chatting
- Docker Model Runner
How to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with Docker Model Runner:
docker model run hf.co/rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
- Lemonade
How to use rozek/LLaMA-2-7B-32K-Instruct_GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull rozek/LLaMA-2-7B-32K-Instruct_GGUF:Q4_K_M
Run and chat with the model
lemonade run user.LLaMA-2-7B-32K-Instruct_GGUF-Q4_K_M
List all available models
lemonade list
Error when trying to ask a question - ggml_allocr_alloc: not enough space in the buffer (needed 178227200, largest block available 19333120)
python main.py "What is the x number?"
ggml_allocr_alloc: not enough space in the buffer (needed 178227200, largest block available 19333120)
GGML_ASSERT: C:\Users\rajesh\AppData\Local\Temp\pip-install-0ohg_aj6\llama-cpp-python_29c4846b4af1471bbb28a41659b32aa3\vendor\llama.cpp\ggml-alloc.c:144: !"not enough space in the buffer"
Try rebooting your PC - your memory seems highly fragmented (or hopelessly filled up)
I have tried to reboot, but it didn't work unfortunately :(
unfortunately, I don't have any experience with the Python version of llama.cpp - I'm using the original C++ variant only, and that has been proven to work. Can you try the original llama.cpp instead?
I am not sure how will that work. I am using this code example in my Windows 11 PC. https://github.com/singlestore-labs/webinar-code-examples/tree/main/llama-2-local
also, i am not sure why i am getting the GGML error, when i am using the GGUF version of model pls
Oh, don't use that - its far too old and hopelessly outdated. You should definitely use the original llama.cpp for GGUF and/or large contexts!!!!
But since the code is in python shouldn't i use the llamacpp python package, instead of the llama.cpp package?
no, llama.cpp has been written in C++, as the name implies
Yes, but this version c++ version was written to run in Mac/linux environment. for windows it will require the python llamacpp package. https://github.com/abetlen/llama-cpp-python
Even then you should use the newest version available, not older than approx. 2 days - that's important because GGUF support is still in the making.
And, since I use Macs only, I can't help you with Windows-specific problems - I'm sorry