Views
No views yet
Q4_K_M GGUF quantization of
alfredplpl/sarashina2-7b-it,
an instruction-tuned version of
sbintuitions/sarashina2-7b.tokenizer_config.json.| File | Quantization | Size | SHA-256 |
|---|---|---|---|
sarashina2-7b-it.Q4_K_M.gguf | Q4_K_M | 4,481,575,744 bytes (4.17 GiB) | 9c8b63cbee3347097cfc03d33d722ff3731dd4fa7c6da79026caa5da606c72e7 |
Q4_K, 33 Q6_K, and 65 F32, which is the mixed layout
expected for Q4_K_M. The embedded general.file_type is 15 and
general.quantization_version is 2.config.json was normalized from the source model configuration
and checked against the GGUF metadata:| Setting | Value |
|---|---|
| Architecture | LlamaForCausalLM / Llama 2 style |
| Parameters | 7.315B |
| Layers | 32 |
| Hidden size | 4096 |
| Intermediate size | 11008 |
| Attention heads | 32 |
| Key/value heads | 32 |
| Context length | 4096 |
| Vocabulary size | 102400 |
| RoPE theta | 10000 |
| RMS norm epsilon | 1e-5 |
1, EOS 2, and PAD 3.llama.cpp revision 95a923a64c7d493ed1cb347d3b55d039fa3b8097
on Apple Silicon. No importance matrix was used for the distributed
Q4_K_M file.huggingface-cli download command.
The equivalent recipe below uses the current hf download command and pins
the exact source-model revision for reproducibility.1# 1. Check out the exact llama.cpp revision
2git clone https://github.com/ggml-org/llama.cpp.git /private/tmp/llama.cpp
3cd /private/tmp/llama.cpp
4git checkout 95a923a64c7d493ed1cb347d3b55d039fa3b8097
5
6# 2. Build for Apple Silicon with Metal enabled
7cmake -B build -DLLAMA_METAL=ON -DCMAKE_BUILD_TYPE=Release
8cmake --build build -j "$(sysctl -n hw.ncpu)"
9
10# 3. Download the exact source model
11mkdir -p /tmp/sarashina2-7b-it-src
12hf download alfredplpl/sarashina2-7b-it \
13 --revision ffabfdf2d19b35d268d47d2c546e9b7a600f1c0b \
14 --local-dir /tmp/sarashina2-7b-it-src
15
16# 4. Supply the tokenizer filename expected by the converter
17cp /tmp/sarashina2-7b-it-src/spiece.model \
18 /tmp/sarashina2-7b-it-src/tokenizer.model
19
20# 5. Convert the source weights to BF16 GGUF
21python convert_hf_to_gguf.py /tmp/sarashina2-7b-it-src \
22 --outfile /tmp/sarashina2-7b-it-bf16.gguf \
23 --outtype bf16
24
25# 6. Quantize without an importance matrix
26./build/bin/llama-quantize \
27 /tmp/sarashina2-7b-it-bf16.gguf \
28 sarashina2-7b-it-q4_k_m.gguf \
29 Q4_K_M \
30 "$(sysctl -n hw.ncpu)"LLAMA_METAL is accepted as a deprecated alias for
GGML_METAL. The quantizer run reported an output of approximately 4.27 GB;
the final artifact distributed here was subsequently measured as exactly
4,481,575,744 bytes (4.48 GB / 4.17 GiB).llama-imatrix is built as a tool; use -DLLAMA_BUILD_TOOLS=ON if it is not
present.1cmake -B build \
2 -DLLAMA_METAL=ON \
3 -DLLAMA_BUILD_TOOLS=ON \
4 -DCMAKE_BUILD_TYPE=Release
5cmake --build build -j "$(sysctl -n hw.ncpu)"
6
7./build/bin/llama-imatrix \
8 -m /tmp/sarashina2-7b-it-bf16.gguf \
9 -f training_texts.txt \
10 --output-file imatrix.dat \
11 -ngl 99
12
13./build/bin/llama-quantize \
14 --imatrix imatrix.dat \
15 /tmp/sarashina2-7b-it-bf16.gguf \
16 sarashina2-7b-it-q4_k_m-imatrix.gguf \
17 Q4_K_M \
18 "$(sysctl -n hw.ncpu)"1hf download RyoSpiralArchitect/sarashina2-7b-it-GGUF \
2 sarashina2-7b-it.Q4_K_M.gguf \
3 --local-dir .
4
5llama-cli \
6 -m sarashina2-7b-it.Q4_K_M.gguf \
7 -cnv \
8 -n 2561llama-server \
2 -m sarashina2-7b-it.Q4_K_M.gguf \
3 --host 127.0.0.1 \
4 --port 80801import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4repo_id = "RyoSpiralArchitect/sarashina2-7b-it-GGUF"
5gguf_file = "sarashina2-7b-it.Q4_K_M.gguf"
6
7tokenizer = AutoTokenizer.from_pretrained(repo_id, gguf_file=gguf_file)
8model = AutoModelForCausalLM.from_pretrained(
9 repo_id,
10 gguf_file=gguf_file,
11 dtype=torch.bfloat16,
12)1<|system|>
2{system message}</s>
3<|user|>
4{user message}</s>
5<|assistant|>
6{assistant message}</s><|assistant|>alfredplpl/sarashina2-7b-it
at revision ffabfdf2d19b35d268d47d2c546e9b7a600f1c0bsbintuitions/sarashina2-7b
at revision 15b989b8a4eb6f68b990787fc1016def7dabf0bbkunishou/oasst2-chat-68k-jaRyoSpiralArchitect