---
title: CharacterGLM-6B
canonical_url: "https://www.modelscope.cn/models/THUCoAI/CharacterGLM-6B"
md_url: "https://www.modelscope.cn/models/THUCoAI/CharacterGLM-6B.md"
repository: THUCoAI/CharacterGLM-6B
last_updated: 2024-02-29
license: other
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - chatglm
architectures:
  - ChatGLMModel
library_name:
  - transformer
  - pytorch
frameworks:
  - Pytorch
inference_backends:
  - "deploy_task text/emb"
  - "lmdeploy 0.9.1"
  - "lmdeploy_turbomind 0.9.1"
  - "sglang 0.5.2"
  - "vllm 0.9.2"
downloads: 4567
stars: 25
---

# CharacterGLM-6B

> CharacterGLM-6B - THUCoAI 在 ModelScope 开源的模型。模型文件和权重，请浏览“模型文件”页面获取。 当前模型的贡献者未提供更加详细的模型介绍，但是您可以通过如下git clone命令，或者ModelScope SDK来下载模型。 Clone with HTTP

THUCoAI/CharacterGLM-6B 是 ModelScope 魔搭社区上的text-generation模型，采用 other 许可，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: THUCoAI/CharacterGLM-6B
- **License**: other
- **Tasks**: text-generation
- **Inference backends**: deploy_task text/emb, lmdeploy 0.9.1, lmdeploy_turbomind 0.9.1, sglang 0.5.2, vllm 0.9.2
- **Downloads**: 4567
- **Stars**: 25
- **Last updated**: 2024-02-29

Source: https://www.modelscope.cn/models/THUCoAI/CharacterGLM-6B

---

###### 模型文件和权重，请浏览“模型文件”页面获取。
###### 当前模型的贡献者未提供更加详细的模型介绍，但是您可以通过如下git clone命令，或者ModelScope SDK来下载模型。
###### Clone with HTTP
```
git clone https://www.modelscope.cn/THUCoAI/CharacterGLM-6B.git
```
###### 如果您是本模型的贡献者，我们邀请您根据[模型贡献文档说明](https://www.modelscope.cn/docs/%E5%A6%82%E4%BD%95%E6%92%B0%E5%86%99%E5%A5%BD%E7%94%A8%E7%9A%84%E6%A8%A1%E5%9E%8B%E5%8D%A1%E7%89%87)，及时完善模型卡片内容。
###### [huggingface链接](https://huggingface.co/thu-coai/CharacterGLM-6B)


代码示例

```python
>>> from transformers import AutoTokenizer, AutoModel
>>> # 假设您通过git将模型下载到了./CharacterGLM-6B目录
>>> tokenizer = AutoTokenizer.from_pretrained("./CharacterGLM-6B", trust_remote_code=True)
>>> model = AutoModel.from_pretrained("./CharacterGLM-6b", trust_remote_code=True, device='cuda')
>>> model = model.eval()
>>> session_meta = {'user_info': '我是陆星辰，是一个男性，是一位知名导演，也是苏梦远的合作导演。我擅长拍摄音乐题材的电影。苏梦远对我的态度是尊敬的，并视我为良师益友。', 'bot_info': '苏梦远，本名苏远心，是一位当红的国内女歌手及演员。在参加选秀节目后，凭借独特的嗓音及出众的舞台魅力迅速成名，进入娱乐圈。她外表美丽动人，但真正的魅力在于她的才华和勤奋。苏梦远是音乐学院毕业的优秀生，善于创作，拥有多首热门原创歌曲。除了音乐方面的成就，她还热衷于慈善事业，积极参加公益活动，用实际行动传递正能量。在工作中，她对待工作非常敬业，拍戏时总是全身心投入角色，赢得了业内人士的赞誉和粉丝的喜爱。虽然在娱乐圈，但她始终保持低调、谦逊的态度，深得同行尊重。在表达时，苏梦远喜欢使用“我们”和“一起”，强调团队精神。', 'bot_name': '苏梦远', 'user_name': '陆星辰'}
>>> response, history = model.chat(tokenizer, session_meta, "你好", history=[])
>>>>>>> add model
```
