HuggingFace镜像/chatglm3-6b-base
模型介绍文件和版本分析
下载使用量0

ChatGLM3-6B-Base

💻 GitHub 仓库 • 🐦 Twitter • 📃 [GLM@ACL 22] [GitHub] • 📃 [GLM-130B@ICLR 23] [GitHub]

👋 加入我们的 Slack 和 微信

📍在 chatglm.cn 体验更大规模的 ChatGLM 模型

介绍 (Introduction)

ChatGLM3-6B 是 ChatGLM 系列最新一代的开源模型,在保留了前两代模型对话流畅、部署门槛低等众多优秀特性的基础上,ChatGLM3-6B 引入了如下特性:

  1. 更强大的基础模型: ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base 采用了更多样的训练数据、更充分的训练步数和更合理的训练策略。在语义、数学、推理、代码、知识等不同角度的数据集上测评显示,ChatGLM3-6B-Base 具有在 10B 以下的预训练模型中最强的性能。
  2. 更完整的功能支持: ChatGLM3-6B 采用了全新设计的 Prompt 格式,除正常的多轮对话外。同时原生支持工具调用(Function Call)、代码执行(Code Interpreter)和 Agent 任务等复杂场景。
  3. 更全面的开源序列: 除了对话模型 ChatGLM3-6B 外,还开源了基础模型 ChatGLM-6B-Base、长文本对话模型 ChatGLM3-6B-32K。以上所有权重对学术研究完全开放,在填写问卷进行登记后亦允许免费商业使用。

本仓库为 ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base。

ChatGLM3-6B 是 ChatGLM 系列最新的开源模型。在保留前两代模型对话流畅、部署门槛低等诸多优秀特性的基础上,ChatGLM3-6B 新增了以下特性:

  1. 更强大的基础模型: ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base 采用了更多样化的训练数据、更充分的训练步数以及更合理的训练策略。在语义、数学、推理、代码、知识等不同类别的数据集上的测评结果表明,ChatGLM3-6B-Base 在 100 亿参数以下的预训练模型中性能表现最佳。
  2. 更全面的功能支持: ChatGLM3-6B 采用了全新设计的 Prompt 格式,除了常规的多轮对话功能外,还原生支持 工具调用(Function Call)、代码执行(Code Interpreter)以及 Agent 任务等复杂场景。
  3. 更完整的开源序列: 除对话模型 ChatGLM3-6B 外,还开源了基础模型 ChatGLM-6B-Base 和长文本对话模型 ChatGLM3-6B-32K。所有模型权重完全开放供学术研究使用,填写问卷完成登记后,亦允许免费商业使用。

本仓库为 ChatGLM3-6B 的基础模型 ChatGLM3-6B-Base。

软件依赖 (Dependencies)

pip install protobuf transformers==4.30.2 cpm_kernels torch>=2.0 gradio mdtex2html sentencepiece accelerate

代码调用 (Code Usage)

作为没有经过人类意图对齐的模型,ChatGLM3-6B-Base 不能用于多轮对话。但是可以进行文本续写。

作为未与人类意图对齐的模型,ChatGLM3-6B-Base 无法用于多轮对话。不过,它可以实现文本续写功能。

from mindnlp.transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm3-6b-base", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm3-6b-base", trust_remote_code=True).half()

inputs = tokenizer(["今天天气真不错"], return_tensors="ms")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0].tolist()))

关于更多的使用说明,包括如何运行命令行和网页版本的 DEMO,以及使用模型量化以节省显存,请参考我们的 Github Repo。

For more instructions, including how to run CLI and web demos, and model quantization, please refer to our Github Repo.

协议 (License)

本仓库的代码依照 Apache-2.0 协议开源,ChatGLM3-6B 模型的权重的使用则需要遵循 Model License。

The code in this repository is open-sourced under the Apache-2.0 license, while the use of the ChatGLM3-6B model weights needs to comply with the Model License.

引用 (Citation)

如果你觉得我们的工作有帮助的话,请考虑引用下列论文。

If you find our work helpful, please consider citing the following papers.

@misc{glm2024chatglm,
      title={ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools}, 
      author={Team GLM and Aohan Zeng and Bin Xu and Bowen Wang and Chenhui Zhang and Da Yin and Diego Rojas and Guanyu Feng and Hanlin Zhao and Hanyu Lai and Hao Yu and Hongning Wang and Jiadai Sun and Jiajie Zhang and Jiale Cheng and Jiayi Gui and Jie Tang and Jing Zhang and Juanzi Li and Lei Zhao and Lindong Wu and Lucen Zhong and Mingdao Liu and Minlie Huang and Peng Zhang and Qinkai Zheng and Rui Lu and Shuaiqi Duan and Shudan Zhang and Shulin Cao and Shuxun Yang and Weng Lam Tam and Wenyi Zhao and Xiao Liu and Xiao Xia and Xiaohan Zhang and Xiaotao Gu and Xin Lv and Xinghan Liu and Xinyi Liu and Xinyue Yang and Xixuan Song and Xunkai Zhang and Yifan An and Yifan Xu and Yilin Niu and Yuantao Yang and Yueyan Li and Yushi Bai and Yuxiao Dong and Zehan Qi and Zhaoyu Wang and Zhen Yang and Zhengxiao Du and Zhenyu Hou and Zihan Wang},
      year={2024},
      eprint={2406.12793},
      archivePrefix={arXiv},
      primaryClass={id='cs.CL' full_name='Computation and Language' is_active=True alt_name='cmp-lg' in_archive='cs' is_general=False description='Covers natural language processing. Roughly includes material in ACM Subject Class I.2.7. Note that work on artificial languages (programming languages, logics, formal systems) that does not explicitly address natural-language issues broadly construed (natural-language processing, computational linguistics, speech, text retrieval, etc.) is not appropriate for this area.'}
}