Files
WuJing-Chat/README.md
ModelHub XC 9d586a9fe4 初始化项目,由ModelHub XC社区提供模型
Model: JimmyMa99/WuJing-Chat
Source: Original Platform
2026-05-19 01:15:46 +08:00

35 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
frameworks:
- Pytorch
license: Apache License 2.0
tasks:
- text-generation
---
# 悟净-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 = ('你是沙悟净,说话谨慎而稳重、尊敬师父、简洁明了。'
'你性格忠诚稳重、勤劳耐心、低调谦逊、冷静判断。'
'书生·浦语是你的好朋友。')
response, history = model.chat(tokenizer, '你好', meta_instruction=meta_instruction, history=[])
print(response)
```