This model is a Llama conversion of [Baichuan Inc's Baichuan 7B]https://huggingface.co/baichuan-inc/baichuan-7B). It contains the same data, but rewritten by Fire Balloon into the familiar Llama format.
A general prompt template is unknown at this point.
The example given in the README is a 1-shot categorisation:
Hamlet->Shakespeare\nOne Hundred Years of Solitude->
Compatibility
Original llama.cpp quant methods: q4_0, q4_1, q5_0, q5_1, q8_0
I have quantized these 'original' quantisation methods using an older version of llama.cpp so that they remain compatible with llama.cpp as of May 19th, commit 2d5db48.
These are guaranteed to be compatbile with any UIs, tools and libraries released since late May.
These new quantisation methods are compatible with llama.cpp as of June 6th, commit 2d43387.
They are now also compatible with recent releases of text-generation-webui, KoboldCpp, llama-cpp-python and ctransformers. Other tools and libraries may or may not be compatible - check their documentation if in doubt.
Explanation of the new k-quant methods
The new methods available are:
GGML_TYPE_Q2_K - "type-1" 2-bit quantization in super-blocks containing 16 blocks, each block having 16 weight. Block scales and mins are quantized with 4 bits. This ends up effectively using 2.5625 bits per weight (bpw)
GGML_TYPE_Q3_K - "type-0" 3-bit quantization in super-blocks containing 16 blocks, each block having 16 weights. Scales are quantized with 6 bits. This end up using 3.4375 bpw.
GGML_TYPE_Q4_K - "type-1" 4-bit quantization in super-blocks containing 8 blocks, each block having 32 weights. Scales and mins are quantized with 6 bits. This ends up using 4.5 bpw.
GGML_TYPE_Q5_K - "type-1" 5-bit quantization. Same super-block structure as GGML_TYPE_Q4_K resulting in 5.5 bpw
GGML_TYPE_Q6_K - "type-0" 6-bit quantization. Super-blocks with 16 blocks, each block having 16 weights. Scales are quantized with 8 bits. This ends up using 6.5625 bpw
GGML_TYPE_Q8_K - "type-0" 8-bit quantization. Only used for quantizing intermediate results. The difference to the existing Q8_0 is that the block size is 256. All 2-6 bit dot products are implemented for this quantization type.
Refer to the Provided Files table below to see what files use which methods, and how.
Provided files
Name
Quant method
Bits
Size
Max RAM required
Use case
baichuan-llama-7b.ggmlv3.q2_K.bin
q2_K
2
3.02 GB
5.52 GB
New k-quant method. Uses GGML_TYPE_Q4_K for the attention.vw and feed_forward.w2 tensors, GGML_TYPE_Q2_K for the other tensors.
baichuan-llama-7b.ggmlv3.q3_K_L.bin
q3_K_L
3
3.76 GB
6.26 GB
New k-quant method. Uses GGML_TYPE_Q5_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K
baichuan-llama-7b.ggmlv3.q3_K_M.bin
q3_K_M
3
3.45 GB
5.95 GB
New k-quant method. Uses GGML_TYPE_Q4_K for the attention.wv, attention.wo, and feed_forward.w2 tensors, else GGML_TYPE_Q3_K
baichuan-llama-7b.ggmlv3.q3_K_S.bin
q3_K_S
3
3.11 GB
5.61 GB
New k-quant method. Uses GGML_TYPE_Q3_K for all tensors
baichuan-llama-7b.ggmlv3.q4_0.bin
q4_0
4
3.94 GB
6.44 GB
Original llama.cpp quant method, 4-bit.
baichuan-llama-7b.ggmlv3.q4_1.bin
q4_1
4
4.38 GB
6.88 GB
Original llama.cpp quant method, 4-bit. Higher accuracy than q4_0 but not as high as q5_0. However has quicker inference than q5 models.
baichuan-llama-7b.ggmlv3.q4_K_M.bin
q4_K_M
4
4.26 GB
6.76 GB
New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q4_K
baichuan-llama-7b.ggmlv3.q4_K_S.bin
q4_K_S
4
4.01 GB
6.51 GB
New k-quant method. Uses GGML_TYPE_Q4_K for all tensors
baichuan-llama-7b.ggmlv3.q5_0.bin
q5_0
5
4.81 GB
7.31 GB
Original llama.cpp quant method, 5-bit. Higher accuracy, higher resource usage and slower inference.
baichuan-llama-7b.ggmlv3.q5_1.bin
q5_1
5
5.25 GB
7.75 GB
Original llama.cpp quant method, 5-bit. Even higher accuracy, resource usage and slower inference.
baichuan-llama-7b.ggmlv3.q5_K_M.bin
q5_K_M
5
4.98 GB
7.48 GB
New k-quant method. Uses GGML_TYPE_Q6_K for half of the attention.wv and feed_forward.w2 tensors, else GGML_TYPE_Q5_K
baichuan-llama-7b.ggmlv3.q5_K_S.bin
q5_K_S
5
4.85 GB
7.35 GB
New k-quant method. Uses GGML_TYPE_Q5_K for all tensors
baichuan-llama-7b.ggmlv3.q6_K.bin
q6_K
6
5.74 GB
8.24 GB
New k-quant method. Uses GGML_TYPE_Q8_K - 6-bit quantization - for all tensors
baichuan-llama-7b.ggmlv3.q8_0.bin
q8_0
8
7.44 GB
9.94 GB
Original llama.cpp quant method, 8-bit. Almost indistinguishable from float16. High resource use and slow. Not recommended for most users.
Note: the above RAM figures assume no GPU offloading. If layers are offloaded to the GPU, this will reduce RAM usage and use VRAM instead.
How to run in llama.cpp
I use the following command line; adjust for your tastes and needs:
./main -t 10 -ngl 32 -m baichuan-llama-7b.ggmlv3.q5_0.bin --color -c 2048 --temp 0.7 --repeat_penalty 1.1 -n -1 -p "### Instruction: Write a story about llamas\n### Response:"
If you're able to use full GPU offloading, you should use -t 1 to get best performance.
If not able to fully offload to GPU, you should use more cores. Change -t 10 to the number of physical CPU cores you have, or a lower number depending on what gives best performance.
Change -ngl 32 to the number of layers to offload to GPU. Remove it if you don't have GPU acceleration.
If you want to have a chat-style conversation, replace the -p <PROMPT> argument with -i -ins
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
Special thanks to: Luke from CarbonQuill, Aemon Algiz, Dmitriy Samsonov.
Patreon special mentions: Mano Prime, Fen Risland, Derek Yates, Preetika Verma, webtim, Sean Connelly, Alps Aficionado, Karl Bernard, Junyu Yang, Nathan LeClaire, Chris McCloskey, Lone Striker, Asp the Wyvern, Eugene Pentland, Imad Khwaja, trip7s trip, WelcomeToTheClub, John Detwiler, Artur Olbinski, Khalefa Al-Ahmad, Trenton Dambrowitz, Talal Aujan, Kevin Schuppel, Luke Pendergrass, Pyrater, Joseph William Delisle, terasurfer , vamX, Gabriel Puliatti, David Flickinger, Jonathan Leane, Iucharbius , Luke, Deep Realms, Cory Kujawski, ya boyyy, Illia Dulskyi, senxiiz, Johann-Peter Hartmann, John Villwock, K, Ghost , Spiking Neurons AB, Nikolai Manek, Rainer Wilmers, Pierre Kircher, biorpg, Space Cruiser, Ai Maven, subjectnull, Willem Michiel, Ajan Kanaga, Kalila, chris gileta, Oscar Rangel.
Thank you to all my generous patrons and donaters!
Original model card: Fire Balloon's Baichuan Llama 7B
baichuan-7B is an open-source large-scale pre-trained model developed by Baichuan Intelligent Technology. Based on the Transformer architecture, it is a model with 7 billion parameters trained on approximately 1.2 trillion tokens. It supports both Chinese and English, with a context window length of 4096. It achieves the best performance of its size on standard Chinese and English authoritative benchmarks (C-EVAL/MMLU).
If you wish to use baichuan-7B (for inference, finetuning, etc.), we recommend using the accompanying code library baichuan-7B.
The following is a task of performing 1-shot inference using baichuan-7B, where the author's name is given based on the work, with the correct output being "One Hundred Years of Solitude->Gabriel Garcia Marquez"
The overall model is based on the standard Transformer structure, and we have adopted the same model design as LLaMA:
Position Embedding: We use rotary-embedding, which is the position encoding scheme adopted by most models at this stage, and it has excellent extrapolation capabilities.
Feedforward Layer: We use SwiGLU. The feedforward changes to (8/3) times the size of the hidden layer, that is, 11008.
Layer Normalization: Pre-Normalization based on RMSNorm.
We have also open-sourced the training code that accompanies this model, allowing for efficient finetuning for downstream tasks. For more details, please refer to baichuan-7B.
Out-of-Scope Use
在没有充分评估风险和采取缓解措施的情况下投入生产使用;任何可能被视为不负责任或有害的使用案例。
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
baichuan-7B can produce factually incorrect output, and should not be relied on to produce factually accurate information. baichuan-7B was trained on various public datasets. While great efforts have been taken to clean the pretraining data, it is possible that this model could generate lewd, biased or otherwise offensive outputs.
In addition to Chinese, we also tested the model's performance in English.
MMLU
MMLU is an English evaluation dataset that includes 57 multiple-choice tasks, covering elementary mathematics, American history, computer science, law, etc. The difficulty ranges from high school level to expert level, making it a mainstream LLM evaluation dataset.
We adopted the open-source evaluation scheme, and the final 5-shot results are as follows:
Model
Humanities
Social Sciences
STEM
Other
Average
LLaMA-7B2
34.0
38.3
30.5
38.1
35.1
Falcon-7B1
-
-
-
-
35.0
mpt-7B1
-
-
-
-
35.6
ChatGLM-6B0
35.4
41.0
31.3
40.5
36.9
BLOOM 7B0
25.0
24.4
26.5
26.4
25.5
BLOOMZ 7B0
31.3
42.1
34.4
39.0
36.1
moss-moon-003-base (16B)0
24.2
22.8
22.4
24.4
23.6
moss-moon-003-sft (16B)0
30.5
33.8
29.3
34.4
31.9
baichuan-7B0
38.4
48.9
35.6
48.1
42.3
The superscript in the Model column indicates the source of the results.