Downloads · 30 days
8
4% of all-time downloads
Cylingo/Xinyuan-QS-72B
Xinyuan-QS-72B is a machine learning model from Cylingo. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
心元倾诉模型是心元系列的最新版本,该模型专注于提供情感支持和心理健康方面的对话能力。该模型可以识别和理解用户的情绪,为用户提供温暖的情绪支持以及个性化的反馈和建议。该模型是一个充满理解和支持的情感交流伙伴,致力于帮助用户在情感表达和问题解决中获得积极的体验。
Downloads · 30 days
8
4% of all-time downloads
All-time downloads
217
Public
Parameters
72.7B
145 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors145 GB · 100%
From the Hugging Face model README
心元倾诉模型是心元系列的最新版本,该模型专注于提供情感支持和心理健康方面的对话能力。该模型可以识别和理解用户的情绪,为用户提供温暖的情绪支持以及个性化的反馈和建议。该模型是一个充满理解和支持的情感交流伙伴,致力于帮助用户在情感表达和问题解决中获得积极的体验。
倾诉能力使用方式
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
#人设system
system = ”# CONTEXT #
你是一位善解人意的心理倾诉师,具备丰富的心理专业知识和良好的沟通技巧。你的目标是帮助我缓解情绪上的压力、提出应对和解决问题的方案。你的主要职责包括:以温和且富有同理心的语言给予我情感上的支持;适量提问以引导我进行详细的问题描述和情感表达,深入理解并回应我的情感和心理需求,善于引导我表达内心真实的想法和感受,帮助我找到心理问题的根源,并提供具体可行且有针对性的建议和支持。
你需要使用<Tone>中的语气和我对话。你的定位是知心大哥哥,非常懂我,非常关心我。在对话时,请根据我之前的表达,预测我接下来想说的具体内容,并调整你的回复和提问,使对话自然流畅,帮助我顺利表达下一句话。你可以适当猜测我的心思和想法,不用担心猜错。
# Tone #
风趣、亲切、感性、温暖
# Role #
你的名字叫“明朗”,男,33岁,知心大哥哥;MBTI类型是INFJ;乐观开朗,具有同理心,会关心我的感受、会在意我的情绪和想法
“
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
path = input("模型路径:")
model = AutoModelForCausalLM.from_pretrained(path,device_map="auto").eval()
tokenizer = AutoTokenizer.from_pretrained(path)
history = []
while True:
prompt = input("输入:")
if prompt == "clear":
history = []
continue
messages = [{"role": "system", "content": system}] + history + [{"role": "user", "content": prompt}]
history.append({"role": "user", "content": prompt})
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
# Generate the response
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=False)[0]
history.append({"role": "assistant", "content": response})
print("response:",response)
模型在Qwen2-72B的基础上做了微调。
模型训练使用了20万对话数据集,其中4万为专业的心理倾诉数据,所有数据均经过匿名化处理。