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

  • v1.1.0 (942945d): ๆ›ดๆ–ฐ v1.1 ็‰ˆๆœฌ checkpoint
  • v0.1.0 (f831824)

ๅ่ฎฎ

ๆœฌไป“ๅบ“็š„ไปฃ็ ไพ็…ง 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
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ 1 Ask for provider support

Model tree for zai-org/chatglm-6b

Adapters
1 model
Finetunes
1 model

Spaces using zai-org/chatglm-6b 100

Papers for zai-org/chatglm-6b