五月天成人小说,中文字幕亚洲欧美专区,久久妇女,亚洲伊人久久大香线蕉综合,日日碰狠狠添天天爽超碰97

ChatGLM-6B
開(kāi)源
ChatGLM-6B 是一個(gè)開(kāi)源的、支持中英雙語(yǔ)問(wèn)答的對(duì)話(huà)語(yǔ)言模型,基于 General Language Model (GLM) 架構(gòu),具有 62 億參數(shù)。結(jié)合模型量化技術(shù),用戶(hù)可以在消費(fèi)級(jí)的顯卡上進(jìn)行本地部署(INT4 量化級(jí)別下最低只需 6GB 顯存)。ChatGLM-6B 使用了和 Chat
  • 模型資訊
  • 模型資料

ChatGLM-6B模型介紹

ChatGLM-6B 是一個(gè)開(kāi)源的、支持中英雙語(yǔ)問(wèn)答的對(duì)話(huà)語(yǔ)言模型,基于 General Language Model (GLM) 架構(gòu),具有 62 億參數(shù)。結(jié)合模型量化技術(shù),用戶(hù)可以在消費(fèi)級(jí)的顯卡上進(jìn)行本地部署(INT4 量化級(jí)別下最低只需 6GB 顯存)。ChatGLM-6B 使用了和 ChatGLM 相同的技術(shù),針對(duì)中文問(wèn)答和對(duì)話(huà)進(jìn)行了優(yōu)化。經(jīng)過(guò)約 1T 標(biāo)識(shí)符的中英雙語(yǔ)訓(xùn)練,輔以監(jiān)督微調(diào)、反饋?zhàn)灾?、人?lèi)反饋強(qiáng)化學(xué)習(xí)等技術(shù)的加持,62 億參數(shù)的 ChatGLM-6B 已經(jīng)能生成相當(dāng)符合人類(lèi)偏好的回答。

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 wit human feedback. With only about 6.2 billion parameters, the model is able to generate answers that are in line with human preference.

環(huán)境搭建

本模型環(huán)境需安裝最新版的modelscope

pip install modelscope==1.4.3 -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html 

軟件依賴(lài)

pip install protobuf==3.20.0 transformers==4.27.1 icetk cpm_kernels

代碼范例

from modelscope.utils.constant import Tasks
from modelscope import Model
from modelscope.pipelines import pipeline
model = Model.from_pretrained('ZhipuAI/ChatGLM-6B', device_map='auto', revision='v1.0.19').half().cuda()
pipe = pipeline(task=Tasks.chat, model=model)
inputs = {'text':'你好', 'history': []}
result = pipe(inputs)
inputs = {'text':'介紹下江南大學(xué)', 'history': result['history']}
result = pipe(inputs)
print(result)

如果modelscope版本小于1.7.0,請(qǐng)使用如下代碼范例:

from modelscope.utils.constant import Tasks
from modelscope.pipelines import pipeline
pipe = pipeline(task=Tasks.chat, model='ZhipuAI/ChatGLM-6B', model_revision='v1.0.16', device_map='auto')
inputs = {'text':'你好', 'history': []}
result = pipe(inputs)
inputs = {'text':'介紹下清華大學(xué)', 'history': result['history']}
result = pipe(inputs)
print(result)

協(xié)議

本倉(cāng)庫(kù)的代碼依照 Apache-2.0 協(xié)議開(kāi)源,ChatGLM-6B 模型的權(quán)重的使用則需要遵循 Model License。

引用

如果你覺(jué)得我們的工作有幫助的話(huà),請(qǐng)考慮引用下列論文:

@inproceedings{
  zeng2023glm-130b,
  title={{GLM}-130B: An Open Bilingual Pre-trained Model},
  author={Aohan Zeng and Xiao Liu and Zhengxiao Du and Zihan Wang and Hanyu Lai and Ming Ding and Zhuoyi Yang and Yifan Xu and Wendi Zheng and Xiao Xia and Weng Lam Tam and Zixuan Ma and Yufei Xue and Jidong Zhai and Wenguang Chen and Zhiyuan Liu and Peng Zhang and Yuxiao Dong and Jie Tang},
  booktitle={The Eleventh International Conference on Learning Representations (ICLR)},
  year={2023},
  url={https://openreview.net/forum?id=-Aw0rrrPUF}
}
@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}
}

歡迎加入我們的微信社區(qū)討論~

wechat

modelhub clone

 git clone https://www.modelscope.cn/ZhipuAI/ChatGLM-6B.git