MBTIGPT_zh_INFP / README.md
JessyTsu1's picture
Update README.md
ec1b56a
|
raw
history blame
No virus
6.57 kB
---
language:
- zh
- en
tags:
- MachineMindset
- MBTI
pipeline_tag: text-generation
inference: false
---
<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>
<br>
## 介绍 (Introduction)
**MM_zh_INFP (Machine_Mindset_zh_INFP)**是FarReel AI Lab和北大深研院合作研发的基于Baichuan-7b-chat的MBTI类型为INFP的中文大模型。MM_zh_INFP经过我们自主构建的大规模MBTI数据集,经多阶段的预训练、微调和DPO训练而来。我们会持续将模型更新到效果更优的版本、并不断补充测试数据。本仓库为MM_zh_INFP模型的仓库。
MM_zh_INFP (Machine_Mindset_zh_INFP)的基础性格特征是**INFP**,这意味着它倾向于展现出创造力、情感深沉和思考内省的特质,这些特点使得它在生成具有情感和情感内涵的文本方面表现出色。
如果您想了解更多关于Machine_Mindset开源模型的细节,我们建议您参阅[GitHub代码库](https://github.com/PKU-YuanGroup/Machine-Mindset/)。
**MM_zh_INFP (Machine_Mindset_zh_INFP)** is a large Chinese language model developed through a collaboration between FarReel AI Lab and Peking University Deep Research Institute, based on Baichuan-7b-chat with an MBTI personality type of INFP. MM_zh_INFP has undergone extensive training, including the creation of a large-scale MBTI dataset, multi-stage pre-training, fine-tuning, and DPO training. We are committed to continuously updating the model to improve its performance and regularly supplementing it with test data. This repository serves as the storage for the MM_zh_INFP model.
The foundational personality trait of **MM_zh_INFP (Machine_Mindset_zh_INFP)** is **INFP**. This means it tends to exhibit traits such as creativity, deep emotional connection, and introspective thinking. These qualities make it excel in generating text with emotional and meaningful content.
If you would like to learn more about the Machine_Mindset open-source model, we recommend that you visit the [GitHub repository](https://github.com/PKU-YuanGroup/Machine-Mindset/) for additional details.<br>
## 要求(Requirements)
* python 3.8及以上版本
* pytorch 1.12及以上版本,推荐2.0及以上版本
* 建议使用CUDA 11.4及以上(GPU用户、flash-attention用户等需考虑此选项)
* python 3.8 and above
* pytorch 1.12 and above, 2.0 and above are recommended
* CUDA 11.4 and above are recommended (this is for GPU users, flash-attention users, etc.)
<br>
## 依赖项 (Dependency)
运行Qwen-7B,请确保满足上述要求,再执行以下pip命令安装依赖库
To run Qwen-7B, please make sure you meet the above requirements, and then execute the following pip commands to install the dependent libraries.
```bash
pip install transformers==4.32.0 accelerate tiktoken einops scipy transformers_stream_generator==0.0.4 peft deepspeed
```
另外,推荐安装`flash-attention`库(**当前已支持flash attention 2**),以实现更高的效率和更低的显存占用。
In addition, it is recommended to install the `flash-attention` library (**we support flash attention 2 now.**) for higher efficiency and lower memory usage.
```bash
git clone https://github.com/Dao-AILab/flash-attention
cd flash-attention && pip install .
# 下方安装可选,安装可能比较缓慢。
# pip install csrc/layer_norm
# pip install csrc/rotary
```
<br>
## 快速使用(Quickstart)
您可以通过以下代码轻松调用:
You can easily call the model with the following code:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.generation import GenerationConfig
# Note: The default behavior now has injection attack prevention off.
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen-7B", trust_remote_code=True)
# use bf16
# model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-7B", device_map="auto", trust_remote_code=True, bf16=True).eval()
# use fp16
# model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-7B", device_map="auto", trust_remote_code=True, fp16=True).eval()
# use cpu only
# model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-7B", device_map="cpu", trust_remote_code=True).eval()
# use auto mode, automatically select precision based on the device.
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-7B", device_map="auto", trust_remote_code=True).eval()
# Specify hyperparameters for generation. But if you use transformers>=4.32.0, there is no need to do this.
# model.generation_config = GenerationConfig.from_pretrained("Qwen/Qwen-7B", trust_remote_code=True)
inputs = tokenizer('蒙古国的首都是乌兰巴托(Ulaanbaatar)\n冰岛的首都是雷克雅未克(Reykjavik)\n埃塞俄比亚的首都是', return_tensors='pt')
inputs = inputs.to(model.device)
pred = model.generate(**inputs)
print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))
# 蒙古国的首都是乌兰巴托(Ulaanbaatar)\n冰岛的首都是雷克雅未克(Reykjavik)\n埃塞俄比亚的首都是亚的斯亚贝巴(Addis Ababa)...
```
关于更多的使用说明,请参考我们的[GitHub repo](https://github.com/QwenLM/Qwen)获取更多信息。
For more information, please refer to our [GitHub repo](https://github.com/QwenLM/Qwen) for more information.
<br>
<br>
## 引用 (Citation)
如果你觉得我们的工作对你有帮助,欢迎引用!
If you find our work helpful, feel free to give us a cite.
```
```
<br>
## 使用协议(License Agreement)
我们的代码遵循Apache2.0协议开源。请查看[LICENSE](https://github.com/PKU-YuanGroup/Machine-Mindset/blob/main/LICENSE)了解具体的开源协议细节。
我们的模型权重基于原始权重的开源协议,所以中文版本是基于baichuan的开源协议细节。支持商用,请查看[model_LICENSE](https://huggingface.co./JessyTsu1/Machine_Mindset_zh_INFP/resolve/main/Machine_Mindset%E5%9F%BA%E4%BA%8Ebaichuan%E7%9A%84%E6%A8%A1%E5%9E%8B%E7%A4%BE%E5%8C%BA%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE.pdf)查看具体细节。
英文版基于[llama2的开源协议](https://ai.meta.com/resources/models-and-libraries/llama-downloads/)
## 联系我们(Contact Us)
Feel free to send an email to [email protected]