This project is a Chinese large language model base generated through incremental pre-training on Chinese datasets based on LLaMA-7B.
Features
This project provides a Chinese pre-trained model obtained through full-tuning, including Huggingface version weights.
Compared to the original LLaMA, this model has significantly improved Chinese understanding and generation capabilities, achieving outstanding results in various downstream tasks. See Evaluation for details.
This project provides tools for converting Huggingface version weights and Meta version weights.
Supports 🤗transformers, and provides command-line tools for easy model testing.
Meta officially released LLaMA does not open-source weights. To comply with relevant licenses, the model released this time is of the patch type, and must be used in conjunction with the official original weights.
We provide a script for installing the patch. After obtaining the official weights through regular channels, you can install the patch as follows:
Note: The installation method of this patch is inplace installation, that is, the installed patch is the complete Huggingface version of this model weight, and you can use transformers to load the model.
Note: This script depends on OpenLMLab/collie, please install this framework using the following command:
For quick and easy model testing, we provide a command-line version of the demo. After successfully installing the patch according to Usage Notes, you can use the script to start an interactive interface:
Open-Chinese-LLaMA-7B on the left, original LLaMA on the right:
text generation
code generation
instructions (Note: None have been Instruct-tuning)
Evaluation
Open-Chinese-LLaMA-7B performs far better than the original LLaMA on various tasks in Chinese and English datasets. The evaluation results of this model on some datasets are given below (the following indicators are Accuracy, the bigger the better):
The model generated by patch_model.py in this project is hf format which can be loaded by 🤗transformers. For convenience, we also provide a conversion tool between the official version model (raw) and hf:
Tip: When converting a model in raw format, you need to specify the tensor parallel size and corresponding device, and it can only be converted on a machine with a corresponding number of graphics cards.