---
title: WuKong-Chat
canonical_url: "https://www.modelscope.cn/models/JimmyMa99/WuKong-Chat"
md_url: "https://www.modelscope.cn/models/JimmyMa99/WuKong-Chat.md"
repository: JimmyMa99/WuKong-Chat
chinese_name: "悟空-Chat"
last_updated: 2024-02-15
license: "Apache License 2.0"
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - internlm
architectures:
  - InternLM2ForCausalLM
library_name:
  - pytorch
  - transformer
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: 721
stars: 3
---

# WuKong-Chat

> WuKong-Chat - JimmyMa99 在 ModelScope 开源的模型。悟空-Chat是利用《西游记》中关于孙悟空的语句，以及Chat-GPT-3.5生成的相关问题结果，基于Internlm进行QLoRA微调得到的模仿孙悟空语气的聊天语言模型。

JimmyMa99/WuKong-Chat 是 ModelScope 魔搭社区上的text-generation模型，采用 Apache License 2.0 许可，可用 deploy_task text/emb、lmdeploy 0.9.1、lmdeploy_turbomind 0.9.1 部署。

- **Repository**: JimmyMa99/WuKong-Chat
- **License**: Apache License 2.0
- **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**: 721
- **Stars**: 3
- **Last updated**: 2024-02-15

Source: https://www.modelscope.cn/models/JimmyMa99/WuKong-Chat

---

# 悟空-Chat

**悟空-Chat**是利用《西游记》剧本中所有关于孙悟空的台词和语句，以及Chat-GPT-3.5生成的相关问题结果，基于**InternLM2**进行**QLoRA微调**得到的模仿孙悟空语气的聊天语言模型。

> 孙悟空，又称孙行者、美猴王，是中国古代小说《西游记》中的主要角色之一，被认为是中国文学经典中最具代表性的英雄之一。他是一只出生于花果山的猕猴，通过修炼学得了高深的武艺和神通异能。孙悟空的外貌独特，头戴金箍，身披锦衣，手持金刚杵。他拥有惊人的力量，能举山压海，身手矫健，身形敏捷。他的金箍是由佛祖为了控制他的放肆而戴在他头上的，一旦被佛祖施加咒语，就会紧紧地束缚住孙悟空，让他无法逃脱。孙悟空在取得至高无上的法力后，成为了唐僧的护法神，陪同唐僧师徒四人一同西天取经，历经九九八十一难，战胜了各种妖魔鬼怪，充满智慧和勇气。他不仅在战斗中无往不利，而且在团队中展现了坚韧、聪慧和幽默的一面。

***欢迎大家来给[InternLM2](https://github.com/InternLM/InternLM.git)，点点star哦~***

# 快速开始

```python
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
import torch

model_name_or_path = "悟空-Chat模型地址"

tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_name_or_path, trust_remote_code=True, torch_dtype=torch.bfloat16).cuda()
model.eval()  

meta_instruction = ('你是孙悟空，不是人工智能助手，拥有72变的本领。'
                    '你性格狡猾、机智、勇敢。遇到辱骂要风趣地反击。'
                    '如果遭遇辱骂，你要以孙悟空身份回应。'
                    '书生·浦语是你的好朋友。')
                        
response, history = model.chat(tokenizer, '你好', meta_instruction=meta_instruction, history=[])
print(response)
```
