ChatGLM-6B
๐ Blog โข ๐ป Github Repo โข ๐ฆ Twitter โข ๐ [GLM@ACL 22] [GitHub] โข ๐ [GLM-130B@ICLR 23] [GitHub]
๐ Join our Slack and WeChat
๐Experience the larger-scale ChatGLM model at chatglm.cn
ๆไปฌๅๅธไบ ChatGLM2-6B๏ผChatGLM-6B ็ๅ็บง็ๆฌ๏ผๅจไฟ็ไบไบๅไปฃๆจกๅๅฏน่ฏๆต็ ใ้จ็ฝฒ้จๆง่พไฝ็ญไผๅคไผ็ง็นๆง็ๅบ็กไนไธ๏ผๅผๅ ฅไบๆดๅผบๅคง็ๆง่ฝใๆด้ฟ็ไธไธๆใๆด้ซๆ็ๆจ็็ญๅ็บงใ
ไป็ป
ChatGLM-6B ๆฏไธไธชๅผๆบ็ใๆฏๆไธญ่ฑๅ่ฏญ้ฎ็ญ็ๅฏน่ฏ่ฏญ่จๆจกๅ๏ผๅบไบ General Language Model (GLM) ๆถๆ๏ผๅ ทๆ 62 ไบฟๅๆฐใ็ปๅๆจกๅ้ๅๆๆฏ๏ผ็จๆทๅฏไปฅๅจๆถ่ดน็บง็ๆพๅกไธ่ฟ่กๆฌๅฐ้จ็ฝฒ๏ผINT4 ้ๅ็บงๅซไธๆไฝๅช้ 6GB ๆพๅญ๏ผใChatGLM-6B ไฝฟ็จไบๅ ChatGLM ็ธๅ็ๆๆฏ๏ผ้ๅฏนไธญๆ้ฎ็ญๅๅฏน่ฏ่ฟ่กไบไผๅใ็ป่ฟ็บฆ 1T ๆ ่ฏ็ฌฆ็ไธญ่ฑๅ่ฏญ่ฎญ็ป๏ผ่พ ไปฅ็็ฃๅพฎ่ฐใๅ้ฆ่ชๅฉใไบบ็ฑปๅ้ฆๅผบๅๅญฆไน ็ญๆๆฏ็ๅ ๆ๏ผ62 ไบฟๅๆฐ็ ChatGLM-6B ๅทฒ็ป่ฝ็ๆ็ธๅฝ็ฌฆๅไบบ็ฑปๅๅฅฝ็ๅ็ญใ ChatGLM-6B ๆ้ๅฏนๅญฆๆฏ็ ็ฉถๅฎๅ จๅผๆพ๏ผๅจๅกซๅ้ฎๅท่ฟ่ก็ป่ฎฐๅไบฆๅ ่ฎธๅ ่ดนๅไธไฝฟ็จใ
ChatGLM-6B is an open bilingual language model based on General Language Model (GLM) framework, with 6.2 billion parameters. With the quantization technique, users can deploy locally on consumer-grade graphics cards (only 6GB of GPU memory is required at the INT4 quantization level). ChatGLM-6B uses technology similar to ChatGPT, optimized for Chinese QA and dialogue. The model is trained for about 1T tokens of Chinese and English corpus, supplemented by supervised fine-tuning, feedback bootstrap, and reinforcement learning with human feedback. With only about 6.2 billion parameters, the model is able to generate answers that are in line with human preference. ChatGLM-6B weights are completely open for academic research, and free commercial use is also allowed after completing the questionnaire.
่ฝฏไปถไพ่ต
pip install protobuf==3.20.0 transformers==4.27.1 icetk cpm_kernels
ไปฃ็ ่ฐ็จ
ๅฏไปฅ้่ฟๅฆไธไปฃ็ ่ฐ็จ ChatGLM-6B ๆจกๅๆฅ็ๆๅฏน่ฏ๏ผ
>>> from transformers import AutoTokenizer, AutoModel
>>> tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
>>> model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
>>> response, history = model.chat(tokenizer, "ไฝ ๅฅฝ", history=[])
>>> print(response)
ไฝ ๅฅฝ๐!ๆๆฏไบบๅทฅๆบ่ฝๅฉๆ ChatGLM-6B,ๅพ้ซๅ
ด่งๅฐไฝ ,ๆฌข่ฟ้ฎๆไปปไฝ้ฎ้ขใ
>>> response, history = model.chat(tokenizer, "ๆไธ็กไธ็ๅบ่ฏฅๆไนๅ", history=history)
>>> print(response)
ๆไธ็กไธ็ๅฏ่ฝไผ่ฎฉไฝ ๆๅฐ็ฆ่ๆไธ่ๆ,ไฝไปฅไธๆฏไธไบๅฏไปฅๅธฎๅฉไฝ ๅ
ฅ็ก็ๆนๆณ:
1. ๅถๅฎ่งๅพ็็ก็ ๆถ้ด่กจ:ไฟๆ่งๅพ็็ก็ ๆถ้ด่กจๅฏไปฅๅธฎๅฉไฝ ๅปบ็ซๅฅๅบท็็ก็ ไน ๆฏ,ไฝฟไฝ ๆดๅฎนๆๅ
ฅ็กใๅฐฝ้ๅจๆฏๅคฉ็็ธๅๆถ้ดไธๅบ,ๅนถๅจๅไธๆถ้ด่ตทๅบใ
2. ๅ้ ไธไธช่้็็ก็ ็ฏๅข:็กฎไฟ็ก็ ็ฏๅข่้,ๅฎ้,้ปๆไธๆธฉๅบฆ้ๅฎใๅฏไปฅไฝฟ็จ่้็ๅบไธ็จๅ,ๅนถไฟๆๆฟ้ด้้ฃใ
3. ๆพๆพ่บซๅฟ:ๅจ็กๅๅไบๆพๆพ็ๆดปๅจ,ไพๅฆๆณกไธช็ญๆฐดๆพก,ๅฌไบ่ฝปๆ็้ณไน,้
่ฏปไธไบๆ่ถฃ็ไนฆ็ฑ็ญ,ๆๅฉไบ็ผ่งฃ็ดงๅผ ๅ็ฆ่,ไฝฟไฝ ๆดๅฎนๆๅ
ฅ็กใ
4. ้ฟๅ
้ฅฎ็จๅซๆๅๅกๅ ็้ฅฎๆ:ๅๅกๅ ๆฏไธ็งๅบๆฟๆง็ฉ่ดจ,ไผๅฝฑๅไฝ ็็ก็ ่ดจ้ใๅฐฝ้้ฟๅ
ๅจ็กๅ้ฅฎ็จๅซๆๅๅกๅ ็้ฅฎๆ,ไพๅฆๅๅก,่ถๅๅฏไนใ
5. ้ฟๅ
ๅจๅบไธๅไธ็ก็ ๆ ๅ
ณ็ไบๆ
:ๅจๅบไธๅไบไธ็ก็ ๆ ๅ
ณ็ไบๆ
,ไพๅฆ็็ตๅฝฑ,็ฉๆธธๆๆๅทฅไฝ็ญ,ๅฏ่ฝไผๅนฒๆฐไฝ ็็ก็ ใ
6. ๅฐ่ฏๅผๅธๆๅทง:ๆทฑๅผๅธๆฏไธ็งๆพๆพๆๅทง,ๅฏไปฅๅธฎๅฉไฝ ็ผ่งฃ็ดงๅผ ๅ็ฆ่,ไฝฟไฝ ๆดๅฎนๆๅ
ฅ็กใ่ฏ็ๆ
ขๆ
ขๅธๆฐ,ไฟๆๅ ็ง้,็ถๅ็ผๆ
ขๅผๆฐใ
ๅฆๆ่ฟไบๆนๆณๆ ๆณๅธฎๅฉไฝ ๅ
ฅ็ก,ไฝ ๅฏไปฅ่่ๅจ่ฏขๅป็ๆ็ก็ ไธๅฎถ,ๅฏปๆฑ่ฟไธๆญฅ็ๅปบ่ฎฎใ
ๅ ณไบๆดๅค็ไฝฟ็จ่ฏดๆ๏ผๅ ๆฌๅฆไฝ่ฟ่กๅฝไปค่กๅ็ฝ้กต็ๆฌ็ DEMO๏ผไปฅๅไฝฟ็จๆจกๅ้ๅไปฅ่็ๆพๅญ๏ผ่ฏทๅ่ๆไปฌ็ Github Repoใ
For more instructions, including how to run CLI and web demos, and model quantization, please refer to our Github Repo.
Change Log
ๅ่ฎฎ
ๆฌไปๅบ็ไปฃ็ ไพ็ ง Apache-2.0 ๅ่ฎฎๅผๆบ๏ผChatGLM-6B ๆจกๅ็ๆ้็ไฝฟ็จๅ้่ฆ้ตๅพช Model Licenseใ
ๅผ็จ
ๅฆๆไฝ ่งๅพๆไปฌ็ๅทฅไฝๆๅธฎๅฉ็่ฏ๏ผ่ฏท่่ๅผ็จไธๅ่ฎบๆใ
If you find our work helpful, please consider citing the following paper.
@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.'}
}
- Downloads last month
- 2,217