CoolFace
Modelpublic

pandalla/MBTIGPT_zh_INTJ

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes11downloads
Model Card

<p align="center"> <img src="https://raw.githubusercontent.com/PKU-YuanGroup/Machine-Mindset/main/images/logo.png" width="650" style="margin-bottom: 0.2;"/> <p> <h2 align="center"> <a href="https://arxiv.org/abs/2311.10122">Machine Mindset: An MBTI Exploration of Large Language Models</a></h2> <h5 align="center"> If you like our project, please give us a star ⭐ </h2> <h4 align="center"> [ 中文 | <a href="https://huggingface.co/FarReelAILab/MachineMindsetenINTJ">English</a> | <a href="https://github.com/PKU-YuanGroup/Machine-Mindset/blob/main/READMEja.md">日本語</a> ] <br>

介绍 (Introduction)

MM_zh_INTJ (Machine_Mindset_zh_INTJ) 是FarReel AI Lab和北大深研院合作研发的基于Baichuan-7b-chat的MBTI类型为INTJ的中文大模型。

MMzhINTJ经过我们自主构建的大规模MBTI数据集,经多阶段的微调和DPO训练而来。我们会持续将模型更新到效果更优的版本、并不断补充测试数据。本仓库为MMzhINTJ模型的仓库。

MMzhINTJ (MachineMindsetzh_INTJ)的基础性格特征是INTJ,更详细的性格描述见16personalities

如果您想了解更多关于Machine_Mindset开源模型的细节,我们建议您参阅GitHub代码库

要求(Requirements)

  • python 3.8及以上版本
  • pytorch 1.12及以上版本,推荐2.0及以上版本
  • 建议使用CUDA 11.4及以上(GPU用户、flash-attention用户等需考虑此选项) <br>

快速使用(Quickstart)

  • 使用HuggingFace Transformers库(单轮对话):
python
  import torch
  from transformers import AutoModelForCausalLM, AutoTokenizer
  from transformers.generation.utils import GenerationConfig
  tokenizer = AutoTokenizer.from_pretrained("FarReelAILab/Machine_Mindset_zh_INTJ", use_fast=False, trust_remote_code=True)
  model = AutoModelForCausalLM.from_pretrained("FarReelAILab/Machine_Mindset_zh_INTJ", device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
  model.generation_config = GenerationConfig.from_pretrained("FarReelAILab/Machine_Mindset_zh_INTJ")
  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库(多轮对话):
python
  import torch
  from transformers import AutoModelForCausalLM, AutoTokenizer
  from transformers.generation.utils import GenerationConfig
  tokenizer = AutoTokenizer.from_pretrained("FarReelAILab/Machine_Mindset_zh_INTJ", use_fast=False, trust_remote_code=True)
  model = AutoModelForCausalLM.from_pretrained("FarReelAILab/Machine_Mindset_zh_INTJ", device_map="auto", torch_dtype=torch.bfloat16, trust_remote_code=True)
  model.generation_config = GenerationConfig.from_pretrained("FarReelAILab/Machine_Mindset_zh_INTJ")
  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推理框架(多轮对话)
bash
  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代码库获取更多信息。

<br>

引用 (Citation)

如果你觉得我们的工作对你有帮助,欢迎引用!

@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}
}

<br>

使用协议(License Agreement)

我们的代码遵循Apache2.0协议开源。请查看LICENSE了解具体的开源协议细节。

我们的模型权重基于原始基础模型权重的开源协议。

中文版本是基于baichuan的开源协议细节,支持商用。请查看model_LICENSE查看具体细节。

英文版基于llama2的开源协议

联系我们(Contact Us)

如果您有任何问题,请邮件联系jiaxicui446@gmail.com,lvliuzh@stu.pku.edu.cn