Instructions to use TheBloke/Llama-2-7B-32K-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/Llama-2-7B-32K-Instruct-GGUF with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TheBloke/Llama-2-7B-32K-Instruct-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TheBloke/Llama-2-7B-32K-Instruct-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/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 serve -hf TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/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 TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf TheBloke/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 TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use TheBloke/Llama-2-7B-32K-Instruct-GGUF with Ollama:
ollama run hf.co/TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use TheBloke/Llama-2-7B-32K-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/TheBloke/Llama-2-7B-32K-Instruct-GGUF:Q4_K_M
- Lemonade
How to use TheBloke/Llama-2-7B-32K-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheBloke/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
- Atomic Chat
Update README.md (#2)
Browse files- Update README.md (50cd5d6fdf72da90420ce80a35ab4ae1d3a8e5ef)
Co-authored-by: JOAN CASTRO <jocastroc@users.noreply.huggingface.co>
README.md
CHANGED
|
@@ -160,7 +160,7 @@ pip3 install huggingface-hub>=0.17.1
|
|
| 160 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
| 161 |
|
| 162 |
```shell
|
| 163 |
-
huggingface-cli download TheBloke/Llama-2-7B-32K-Instruct-GGUF llama-2-7b-32k-instruct.
|
| 164 |
```
|
| 165 |
|
| 166 |
<details>
|
|
@@ -183,7 +183,7 @@ pip3 install hf_transfer
|
|
| 183 |
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
| 184 |
|
| 185 |
```shell
|
| 186 |
-
HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Llama-2-7B-32K-Instruct-GGUF llama-2-7b-32k-instruct.
|
| 187 |
```
|
| 188 |
|
| 189 |
Windows CLI users: Use `set HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1` before running the download command.
|
|
@@ -196,7 +196,7 @@ Windows CLI users: Use `set HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1` before running
|
|
| 196 |
Make sure you are using `llama.cpp` from commit [d0cee0d36d5be95a0d9088b674dbb27354107221](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
|
| 197 |
|
| 198 |
```shell
|
| 199 |
-
./main -ngl 32 -m llama-2-7b-32k-instruct.
|
| 200 |
```
|
| 201 |
|
| 202 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
|
@@ -236,7 +236,7 @@ CT_METAL=1 pip install ctransformers>=0.2.24 --no-binary ctransformers
|
|
| 236 |
from ctransformers import AutoModelForCausalLM
|
| 237 |
|
| 238 |
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
| 239 |
-
llm = AutoModelForCausalLM.from_pretrained("TheBloke/Llama-2-7B-32K-Instruct-GGUF", model_file="llama-2-7b-32k-instruct.
|
| 240 |
|
| 241 |
print(llm("AI is going to"))
|
| 242 |
```
|
|
|
|
| 160 |
Then you can download any individual model file to the current directory, at high speed, with a command like this:
|
| 161 |
|
| 162 |
```shell
|
| 163 |
+
huggingface-cli download TheBloke/Llama-2-7B-32K-Instruct-GGUF llama-2-7b-32k-instruct.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
| 164 |
```
|
| 165 |
|
| 166 |
<details>
|
|
|
|
| 183 |
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
| 184 |
|
| 185 |
```shell
|
| 186 |
+
HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Llama-2-7B-32K-Instruct-GGUF llama-2-7b-32k-instruct.Q4_K_M.gguf --local-dir . --local-dir-use-symlinks False
|
| 187 |
```
|
| 188 |
|
| 189 |
Windows CLI users: Use `set HUGGINGFACE_HUB_ENABLE_HF_TRANSFER=1` before running the download command.
|
|
|
|
| 196 |
Make sure you are using `llama.cpp` from commit [d0cee0d36d5be95a0d9088b674dbb27354107221](https://github.com/ggerganov/llama.cpp/commit/d0cee0d36d5be95a0d9088b674dbb27354107221) or later.
|
| 197 |
|
| 198 |
```shell
|
| 199 |
+
./main -ngl 32 -m llama-2-7b-32k-instruct.Q4_K_M.gguf --color -c 4096 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "[INST]\n{prompt}\n[\INST]"
|
| 200 |
```
|
| 201 |
|
| 202 |
Change `-ngl 32` to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
|
|
|
|
| 236 |
from ctransformers import AutoModelForCausalLM
|
| 237 |
|
| 238 |
# Set gpu_layers to the number of layers to offload to GPU. Set to 0 if no GPU acceleration is available on your system.
|
| 239 |
+
llm = AutoModelForCausalLM.from_pretrained("TheBloke/Llama-2-7B-32K-Instruct-GGUF", model_file="llama-2-7b-32k-instruct.Q4_K_M.gguf", model_type="llama", gpu_layers=50)
|
| 240 |
|
| 241 |
print(llm("AI is going to"))
|
| 242 |
```
|