Machine Mindset: An MBTI Exploration of Large Language Models
Paper
•
2312.12999
•
Published
•
4
MM_zh_ISTP (Machine_Mindset_zh_ISTP) 是FarReel AI Lab和北大深研院合作研发的基于Baichuan-7b-chat的MBTI类型为ISTP的中文大模型。
MM_zh_ISTP经过我们自主构建的大规模MBTI数据集,经多阶段的微调和DPO训练而来。我们会持续将模型更新到效果更优的版本、并不断补充测试数据。本仓库为MM_zh_ISTP模型的仓库。
MM_zh_ISTP (Machine_Mindset_zh_ISTP)的基础性格特征是ISTP,更详细的性格描述见16personalities。
如果您想了解更多关于Machine_Mindset开源模型的细节,我们建议您参阅GitHub代码库。
使用HuggingFace Transformers库(单轮对话):
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.generation.utils import GenerationConfig
tokenizer = AutoTokenizer.from_pretrained("FarReelAILab/Machine_Mindset_zh_ISTP", use_fast=False, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("FarReelAILab/Machine_Mindset_zh_ISTP", device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained("FarReelAILab/Machine_Mindset_zh_ISTP")
messages = []
messages.append({"role": "user", "content": "你的MBTI人格是什么"})
response = model.chat(tokenizer, messages)
print(response)
messages.append({'role': 'assistant', 'content': response})
messages.append({"role": "user", "content": "和一群人聚会一天回到家,你会是什么感受"})
response = model.chat(tokenizer, messages)
print(response)
使用HuggingFace Transformers库(多轮对话):
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.generation.utils import GenerationConfig
tokenizer = AutoTokenizer.from_pretrained("FarReelAILab/Machine_Mindset_zh_ISTP", use_fast=False, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("FarReelAILab/Machine_Mindset_zh_ISTP", device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
model.generation_config = GenerationConfig.from_pretrained("FarReelAILab/Machine_Mindset_zh_ISTP")
messages = []
print("####Enter 'exit' to exit.")
print("####Enter 'clear' to clear the chat history.")
while True:
user=str(input("User:"))
if user.strip()=="exit":
break
elif user.strip()=="clear":
messages=[]
continue
messages.append({"role": "user", "content": user})
response = model.chat(tokenizer, messages)
print("Assistant:", response)
messages.append({"role": "assistant", "content": str(response)})
使用LLaMA-Factory推理框架(多轮对话)
git clone https://github.com/hiyouga/LLaMA-Factory.git
cd LLaMA-Factory
python ./src/cli_demo.py \
--model_name_or_path /path_to_your_local_model \
--template baichuan2 #如果您使用的是中文模型,template须指定为baichuan2;如果您使用的是英文模型,template须指定为llama2
关于更多的使用说明,请参考我们的GitHub代码库获取更多信息。
如果你觉得我们的工作对你有帮助,欢迎引用!
@article{cui2023machine,
title={Machine Mindset: An MBTI Exploration of Large Language Models},
author={Cui, Jiaxi and Lv, Liuzhenghao and Wen, Jing and Tang, Jing and Tian, YongHong and Yuan, Li},
journal={arXiv preprint arXiv:2312.12999},
year={2023}
}
我们的代码遵循Apache2.0协议开源。请查看LICENSE了解具体的开源协议细节。
我们的模型权重基于原始基础模型权重的开源协议。
中文版本是基于baichuan的开源协议细节,支持商用。请查看model_LICENSE查看具体细节。
英文版基于llama2的开源协议
如果您有任何问题,请邮件联系[email protected],[email protected]