Baichuan-13B-Chat is the aligned version in the Baichuan-13B series of models, and the pre-trained model can be found at
Baichuan-13B-Base
.
Baichuan-13B
is an open-source, commercially usable large-scale language model developed by Baichuan Intelligence, following
Baichuan-7B
. With 13 billion parameters, it achieves the best performance in standard Chinese and English benchmarks among models of its size. This release includes two versions: pre-training (Baichuan-13B-Base) and alignment (Baichuan-13B-Chat). Baichuan-13B has the following features:
Larger size, more data
: Baichuan-13B further expands the parameter volume to 13 billion based on
Baichuan-7B
, and has trained 1.4 trillion tokens on high-quality corpora, exceeding LLaMA-13B by 40%. It is currently the model with the most training data in the open-source 13B size. It supports both Chinese and English, uses ALiBi position encoding, and has a context window length of 4096.
Open-source pre-training and alignment models simultaneously
: The pre-training model is a "base" suitable for developers, while the general public has a stronger demand for alignment models with dialogue capabilities. Therefore, in this open-source release, we also released the alignment model (Baichuan-13B-Chat), which has strong dialogue capabilities and is ready to use. It can be easily deployed with just a few lines of code.
More efficient inference
: To support a wider range of users, we have open-sourced the INT8 and INT4 quantized versions. The model can be conveniently deployed on consumer GPUs like the Nvidia 3090 with almost no performance loss.
Open-source, free, and commercially usable
: Baichuan-13B is not only fully open to academic research, but developers can also use it for free commercially after applying for and receiving official commercial permission via email.
Here is an example of a conversation using Baichuan-13B-Chat, the correct output is "K2. The world's second highest peak - K2, also known as Mount Godwin-Austen or Chhogori, with an altitude of 8611 meters, is located on the China-Pakistan border in the Karakoram Range."
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.generation.utils import GenerationConfig
tokenizer = AutoTokenizer.from_pretrained("baichuan-inc/Baichuan-13B-Chat", use_fast=False, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan-13B-Chat", device_map="auto", torch_dtype=torch.float16, trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained("baichuan-inc/Baichuan-13B-Chat")
messages = []
messages.append({"role": "user", "content": "Which moutain is the second highest one in the world?"})
response = model.chat(tokenizer, messages)
print(response)
Baichuan-13B supports int8 and int4 quantization, users only need to make a simple two-line change in the inference code to implement it. Please note, if quantization is done to save GPU memory, the original precision model should be loaded onto the CPU before starting quantization. Avoid adding parameters such as
device_map='auto'
or others that could cause the original precision model to be loaded directly onto the GPU when executing
from_pretrained
.
使用 int8 量化 (To use int8 quantization):
model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan-13B-Chat", torch_dtype=torch.float16, trust_remote_code=True)
model = model.quantize(8).cuda()
同样的,如需使用 int4 量化 (Similarly, to use int4 quantization):
model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan-13B-Chat", torch_dtype=torch.float16, trust_remote_code=True)
model = model.quantize(4).cuda()
模型详情
模型描述
Developed by:
百川智能(Baichuan Intelligent Technology)
The overall model is based on Baichuan-7B. In order to achieve better inference performance, Baichuan-13B uses ALiBi linear bias technology, which has a smaller computational load compared to Rotary Embedding, and significantly improves inference performance. Compared with the standard LLaMA-13B, the average inference speed (tokens/s) for generating 2000 tokens has been tested to increase by 31.6%:
We hereby declare that our development team has not developed any applications based on the Baichuan-13B model, whether on iOS, Android, the web, or any other platform. We strongly urge all users not to use the Baichuan-13B model for any activities that harm national social security or are illegal. In addition, we also ask users not to use the Baichuan-13B model for internet services that have not undergone appropriate security review and filing. We hope that all users will adhere to this principle to ensure that technological development takes place in a regulated and legal environment.
We have done our utmost to ensure the compliance of the data used in the model training process. However, despite our great efforts, due to the complexity of the model and data, there may still be some unforeseen issues. Therefore, we will not take any responsibility for any issues arising from the use of the Baichuan-13B open-source model, including but not limited to data security issues, public opinion risks, or any risks and problems arising from the model being misled, misused, disseminated, or improperly exploited.
Runs of baichuan-inc Baichuan-13B-Chat on huggingface.co
6.4K
Total runs
0
24-hour runs
-1.2K
3-day runs
-1.6K
7-day runs
-452
30-day runs
More Information About Baichuan-13B-Chat huggingface.co Model
Baichuan-13B-Chat huggingface.co
Baichuan-13B-Chat huggingface.co is an AI model on huggingface.co that provides Baichuan-13B-Chat's model effect (), which can be used instantly with this baichuan-inc Baichuan-13B-Chat model. huggingface.co supports a free trial of the Baichuan-13B-Chat model, and also provides paid use of the Baichuan-13B-Chat. Support call Baichuan-13B-Chat model through api, including Node.js, Python, http.
Baichuan-13B-Chat huggingface.co is an online trial and call api platform, which integrates Baichuan-13B-Chat's modeling effects, including api services, and provides a free online trial of Baichuan-13B-Chat, you can try Baichuan-13B-Chat online for free by clicking the link below.
baichuan-inc Baichuan-13B-Chat online free url in huggingface.co:
Baichuan-13B-Chat is an open source model from GitHub that offers a free installation service, and any user can find Baichuan-13B-Chat on GitHub to install. At the same time, huggingface.co provides the effect of Baichuan-13B-Chat install, users can directly use Baichuan-13B-Chat installed effect in huggingface.co for debugging and trial. It also supports api for free installation.