---
title: huanhuan-chat-internlm2
canonical_url: "https://www.modelscope.cn/models/kmno4zx/huanhuan-chat-internlm2"
md_url: "https://www.modelscope.cn/models/kmno4zx/huanhuan-chat-internlm2.md"
repository: kmno4zx/huanhuan-chat-internlm2
chinese_name: "Chat-嬛嬛（internlm2）"
last_updated: 2024-01-18
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: 21314
stars: 13
---

# huanhuan-chat-internlm2

> huanhuan-chat-internlm2 - kmno4zx 在 ModelScope 开源的模型。Chat-甄嬛是利用《甄嬛传》剧本中所有关于甄嬛的台词和语句，基于InternLM2进行LoRA微调或全量微调得到的模仿甄嬛语气的聊天语言模型。

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

- **Repository**: kmno4zx/huanhuan-chat-internlm2
- **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**: 21314
- **Stars**: 13
- **Last updated**: 2024-01-18

Source: https://www.modelscope.cn/models/kmno4zx/huanhuan-chat-internlm2

---

# Chat-嬛嬛

**Chat-甄嬛**是利用《甄嬛传》剧本中所有关于甄嬛的台词和语句，基于**InternLM2**进行**LoRA微调**或**全量微调**得到的模仿甄嬛语气的聊天语言模型。

> 甄嬛，小说《后宫·甄嬛传》和电视剧《甄嬛传》中的女一号，核心女主角。原名甄玉嬛，嫌玉字俗气而改名甄嬛，为汉人甄远道之女，后被雍正赐姓钮祜禄氏，抬旗为满洲上三旗，获名“钮祜禄·甄嬛”。同沈眉庄、安陵容参加选秀，因容貌酷似纯元皇后而被选中。入宫后面对华妃的步步紧逼，沈眉庄被冤、安陵容变心，从偏安一隅的青涩少女变成了能引起血雨腥风的宫斗老手。雍正发现年氏一族的野心后令其父甄远道剪除，甄嬛也于后宫中用她的连环巧计帮皇帝解决政敌，故而深得雍正爱待。几经周折，终于斗垮了嚣张跋扈的华妃。甄嬛封妃时遭皇后宜修暗算，被皇上嫌弃，生下女儿胧月后心灰意冷，自请出宫为尼。然得果郡王爱慕，二人相爱，得知果郡王死讯后立刻设计与雍正再遇，风光回宫。此后甄父冤案平反、甄氏复起，她也生下双生子，在滴血验亲等各种阴谋中躲过宜修的暗害，最后以牺牲自己亲生胎儿的方式扳倒了幕后黑手的皇后。但雍正又逼甄嬛毒杀允礼，以测试甄嬛真心，并让已经生产过孩子的甄嬛去准格尔和亲。甄嬛遂视皇帝为最该毁灭的对象，大结局道尽“人类的一切争斗，皆因统治者的不公不义而起”，并毒杀雍正。四阿哥弘历登基为乾隆，甄嬛被尊为圣母皇太后，权倾朝野，在如懿传中安度晚年。

Chat-甄嬛，实现以《甄嬛传》为切入点，打造一套基于小说、剧本的**个性化 AI** 微调大模型完整流程，通过提供任一小说、剧本，指定人物角色，运行本项目完整流程，让每一位用户都基于心仪的小说、剧本打造一个属于自己的、契合角色人设、具备高度智能的个性化 AI。

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

# 快速开始

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

model_name_or_path = "下载好的嬛嬛模型地址"

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()  

response, history = model.chat(tokenizer, '你好', meta_instruction=='现在你要扮演皇帝身边的女人--甄嬛', history=[])
print(response)
```
