?? Github Repo ? ?? Twitter ? ?? [GLM@ACL 22] [GitHub] ? ?? [GLM-130B@ICLR 23] [GitHub]
ChatGLM2-6B 是開源中英雙語對話模型 ChatGLM-6B 的第二代版本,在保留了初代模型對話流暢、部署門檻較低等眾多優(yōu)秀特性的基礎(chǔ)之上,ChatGLM2-6B 引入了如下新特性:
ChatGLM2-6B is the second-generation version of the open-source bilingual (Chinese-English) chat model ChatGLM-6B. It retains the smooth conversation flow and low deployment threshold of the first-generation model, while introducing the following new features:
pip install --upgrade torch
pip install transformers -U
# modelscope >= 1.7.2
關(guān)于更多的使用說明,包括如何運(yùn)行命令行和網(wǎng)頁版本的 DEMO,以及使用模型量化以節(jié)省顯存,請參考我們的 Github Repo。
For more instructions, including how to run CLI and web demos, and model quantization, please refer to our Github Repo.
# 備注:最新模型版本要求modelscope >= 1.7.2
# pip install modelscope -U
from modelscope.utils.constant import Tasks
from modelscope import Model
from modelscope.pipelines import pipeline
model = Model.from_pretrained('ZhipuAI/chatglm2-6b', device_map='auto', revision='v1.0.7')
pipe = pipeline(task=Tasks.chat, model=model)
inputs = {'text':'你好', 'history': []}
result = pipe(inputs)
inputs = {'text':'介紹下清華大學(xué)', 'history': result['history']}
result = pipe(inputs)
print(result)
本倉庫的代碼依照 Apache-2.0 協(xié)議開源,ChatGLM2-6B 模型的權(quán)重的使用則需要遵循 Model License。
如果你覺得我們的工作有幫助的話,請考慮引用下列論文,ChatGLM2-6B 的論文會(huì)在近期公布,盡情期待~
@article{zeng2022glm,
title={Glm-130b: An open bilingual pre-trained model},
author={Zeng, Aohan and Liu, Xiao and Du, Zhengxiao and Wang, Zihan and Lai, Hanyu and Ding, Ming and Yang, Zhuoyi and Xu, Yifan and Zheng, Wendi and Xia, Xiao and others},
journal={arXiv preprint arXiv:2210.02414},
year={2022}
}
@inproceedings{du2022glm,
title={GLM: General Language Model Pretraining with Autoregressive Blank Infilling},
author={Du, Zhengxiao and Qian, Yujie and Liu, Xiao and Ding, Ming and Qiu, Jiezhong and Yang, Zhilin and Tang, Jie},
booktitle={Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
pages={320--335},
year={2022}
}