BlueLM-7B-Chat-32K-GPTQ
? github • ? LICENSE • ? vivo Developers • ? WeChat
模型介绍
BlueLM 是由 vivo AI 全球研究院自主研发的大规模预训练语言模型,本次发布包含 7B 基础模型和 7B 对话模型,同时我们开源了支持 32K 的长文本基础模型和对话模型。
- 更大量的优质数据:高质量语料库进行训练,规模达到了 2.6 万亿 的 token 数,该语料库包含中文、英文以及少量日韩数据。
- 更优的效果:其中 BlueLM-7B-Chat 在 C-Eval 和 CMMLU 上均取得领先结果,对比同尺寸开源模型中具有较强的竞争力。
- 长文本支持:BlueLM-7B-Base-32K 和 BlueLM-7B-Chat-32K 均支持 32K 长文本,在保持基础能力相当情况下,能够支持更长上下文理解。
- 协议说明:BlueLM 系列欢迎开发者进行学术研究和商业应用。
本次发布基座模型下载链接见:
Base Model | Chat Model | 4bits Quantized Chat Model | |
---|---|---|---|
7B-2k | BlueLM-7B-Base | BlueLM-7B-Chat | BlueLM-7B-Chat-4bits |
7B-32K | BlueLM-7B-Base-32K | BlueLM-7B-Chat-32K | - |
评测结果
为了保证模型评测的一致性,我们采用 OpenCompass 进行相关榜单的评测。我们分别在 C-Eval、MMLU、CMMLU、GaoKao、AGIEval、BBH、GSM8K、MATH 和 HumanEval 榜单对 BlueLM 的通用能力、数学能力和代码能力进行了测试。
Model | C-Eval | MMLU | CMMLU | Gaokao | AGIEval | BBH | GSM8K | MATH | HumanEval |
---|---|---|---|---|---|---|---|---|---|
5-shot | 5-shot | 5-shot | 0-shot | 0-shot | 3-shot | 4-shot | 5-shot | 0-shot | |
GPT-4 | 69.9 | 86.4 | 71.2 | 72.3 | 55.1 | 86.7 | 91.4 | 45.8 | 74.4 |
ChatGPT | 52.5 | 70.0 | 53.9 | 51.1 | 39.9 | 70.1 | 78.2 | 28 | 73.2 |
LLaMA2-7B | 32.5 | 45.3 | 31.8 | 18.9 | 21.8 | 38.2 | 16.7 | 3.3 | 12.8 |
ChatGLM2-6B(Base) | 51.7 | 47.9 | 50.0 | - | - | 33.7 | 32.4 | 6.5 | - |
Baichuan2-7B | 56.3 | 54.7 | 57.0 | 34.8 | 34.6 | 41.8 | 24.6 | 5.4 | 17.7 |
BlueLM-7B-Base | 67.5 | 55.2 | 66.6 | 58.9 | 43.4 | 41.7 | 27.2 | 6.2 | 18.3 |
BlueLM-7B-Chat | 72.7 | 50.7 | 74.2 | 48.7 | 43.4 | 65.6 | 51.9 | 13.4 | 21.3 |
模型下载
可以通过 git 的方式或 modelscope API 的方式下载我们发布的模型。
Git 下载
git lfs install
git clone https://www.modelscope.cn/vivo-ai/BlueLM-7B-Chat-32K-GPTQ.git
Modelscope API 下载
from modelscope import snapshot_download
model_dir = snapshot_download("vivo-ai/BlueLM-7B-Chat-32K-GPTQ", revision="v1.0.0")
推理部署
>>> import torch
>>> from modelscope import AutoModelForCausalLM, AutoTokenizer, snapshot_download
>>> model_dir = snapshot_download("vivo-ai/BlueLM-7B-Chat-32K-GPTQ", revision="v1.0.0")
>>> tokenizer = AutoTokenizer.from_pretrained(model_dir, trust_remote_code=True, use_fast=False)
>>> model = AutoModelForCausalLM.from_pretrained(model_dir, device_map="cuda:0", torch_dtype=torch.float16, trust_remote_code=True, low_cpu_mem_usage=True, use_cache=False)
>>> model = model.eval()
>>> inputs = tokenizer("[|Human|]:写一篇关于刘慈欣《三体》小说的读后感,1000字左右[|AI|]:", return_tensors="pt")
>>> inputs = inputs.to("cuda:0")
>>> pred = model.generate(**inputs, max_new_tokens=2048, repetition_penalty=1.1)
>>> print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))
更多使用说明,请参考我们的 Github 仓库。
协议
社区使用代码依照 Apache-2.0 协议开源,且使用 BlueLM 模型权重需要遵循 vivo_BlueLM模型许可协议。
引用
欢迎阅读我们的技术报告 BlueLM: An Open Multilingual 7B Language Model!
@misc{2023bluelm,
title={BlueLM: An Open Multilingual 7B Language Model},
author={BlueLM Team},
howpublished = {\url{https://github.com/vivo-ai-lab/BlueLM}},
year={2023}
}
评论