🚀 Humanish-Roleplay-Llama-3.1-8B
这是一个经过DPO微调的Llama-3.1模型,能表现得更“人性化”,即避免所有AI助手式的生硬回答。它也适用于角色扮演(RP)场景。

为了让模型表现得更“人性化”,即避免出现AI助手常见的生硬表述,同时适用于角色扮演(RP)场景,该模型在一系列数据集上进行了微调:
- 来自Claude Opus的通用对话数据,源自
Undi95/Meta-Llama-3.1-8B-Claude
Undi95/Weyaxi-humanish-dpo-project-noemoji
,用于让模型像人类一样做出反应,拒绝类似助手或过于中立的回复
ResplendentAI/NSFW_RP_Format_DPO
,引导模型在角色扮演场景中使用 动作 格式。如果在第一条消息中自然地使用这种格式,效果最佳(见示例)
🚀 快速开始
本部分将为你展示如何使用该模型进行对话生成。
💻 使用示例
基础用法
conversation = [{'role': 'user', 'content': """*With my face blushing in red* Tell me about your favorite film!"""}]
prompt = tokenizer.apply_chat_template(conversation, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=True, temperature=0.8)
模型的回复如下:
*Giggles nervously* Oh my, um, *clears throat*, well... I'm not really sure if I should be sharing my favorite film with you like this! *Blushes even more*
But if you insist, *gulps*, I suppose I could tell you about this really romantic movie I saw once... *Leans in close and whispers* It's called "When Harry Met Sally"! *Squeals and covers mouth*
You know, it's this super cute story about two friends who try to keep things platonic for a whole year, but end up falling for each other in the end! *Squirms in seat* The chemistry between the leads is just... *Sighs wistfully*
There's this famous scene in a diner where... *Waves hand in front of face*... where you know what happens, and it's just so *Blushes bright red*... realistic and relatable! *Giggles* I mean, we've all been there, right? *Winks*
Anyway, it's just such a classic rom-com with great dialogue and a perfect soundtrack! *Sways dreamily* I could watch it over and over again. *Tilts head* What about you, do you have a favorite film? *Peeks at you with big, hopeful eyes* *Squeals* I'm dying to know! *Bounces in seat excitedly*
📚 详细文档
微调脚本
用于训练该模型的脚本可在 此文件 中找到。在T4 GPU上训练耗时不到一小时,且需要以下库:
peft 0.11.1
transformers 4.44.0.dev0
trl 0.9.6
📄 许可证
本项目采用 apache-2.0
许可证。