{"id":13753809,"url":"https://github.com/X-PLUG/ChatPLUG","last_synced_at":"2025-05-09T21:36:06.909Z","repository":{"id":153581529,"uuid":"628608540","full_name":"X-PLUG/ChatPLUG","owner":"X-PLUG","description":"A Chinese Open-Domain Dialogue System","archived":false,"fork":false,"pushed_at":"2023-08-16T13:12:07.000Z","size":30470,"stargazers_count":294,"open_issues_count":0,"forks_count":23,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-03-25T06:38:39.214Z","etag":null,"topics":["chat","chatbot","chatgpt","chinese","dialogue","encoder-decoder","instruction-finetuning","knowledge-augment","large-language-models","open-domain-dialogue-system","personality","pretraining"],"latest_commit_sha":null,"homepage":"https://www.modelscope.cn/studios/damo/role_play_chat/summary","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/X-PLUG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-04-16T13:40:16.000Z","updated_at":"2024-03-20T09:43:19.000Z","dependencies_parsed_at":"2024-01-18T04:56:28.889Z","dependency_job_id":"f240d210-0ec9-47a6-a58c-c1c5d5783302","html_url":"https://github.com/X-PLUG/ChatPLUG","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X-PLUG%2FChatPLUG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X-PLUG%2FChatPLUG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X-PLUG%2FChatPLUG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X-PLUG%2FChatPLUG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/X-PLUG","download_url":"https://codeload.github.com/X-PLUG/ChatPLUG/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224884615,"owners_count":17386121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","chatbot","chatgpt","chinese","dialogue","encoder-decoder","instruction-finetuning","knowledge-augment","large-language-models","open-domain-dialogue-system","personality","pretraining"],"created_at":"2024-08-03T09:01:30.069Z","updated_at":"2025-05-09T21:36:06.884Z","avatar_url":"https://github.com/X-PLUG.png","language":"Python","readme":"# ChatPLUG: Chinese Personalized Large Language Model\n\n[![](assets/Demo-ModelScope-brightgreen.svg)](https://www.modelscope.cn/studios/damo/role_play_chat/summary)\n[![](assets/Paper-Arxiv-orange.svg)](https://arxiv.org/abs/2304.07849)\n![Hex.pm](https://img.shields.io/hexpm/l/plug)\n[![docs](https://img.shields.io/badge/docs-latest-blue)](https://chatplug.readthedocs.io/zh_CN/latest/)\n[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FX-PLUG%2FChatP\u0026count_bg=%23E97EBA\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=visitors\u0026edge_flat=false)](https://hits.seeyoufarm.com)\n\nThis is the repo for the [ChatPLUG](./ChatPLUG.md) project, which aims to build and share a Chinese open-domain dialogue system.\n\n\u003chr\u003e\n\n| 爱用emoji的萌妹子小婉  |  富有智慧的得道高僧 | 会说古文的的三国NPC关羽 |\n:-------------------------:|:-------------------------:|:-------------------------:\n\u003cimg src=\"assets/xiaowan.gif\"  width=\"80%\" /\u003e | \u003cimg src=\"assets/gaoseng.gif\"  width=\"90%\" /\u003e | \u003cimg src=\"assets/guanyu.gif\"   width=\"80%\" /\u003e \n\n## News\n- 🔥 ChatPLUG-13B will soon be released on ModelScope for research.\n- [2023/05/23] Add guides about [retrieval](https://chatplug.readthedocs.io/zh_CN/latest/retrieval.html) and [role-play](https://chatplug.readthedocs.io/zh_CN/latest/roleplay.html)\n- [2023/05/10] Add training code, which helps train custom models and build chatbots quickly and easily.\n- [2023/04/26] Try our [Role-Play-Chat Online Demo](https://modelscope.cn/studios/damo/role_play_chat/summary) in ModelScope Now!\n- [2023/04/19] Add content including spotlights, results and limitations. Upload models to [ModelScope](https://modelscope.cn/my/overview). \n- [2023/04/16] Initialize project.\n\n\n## Online Demo\n[Role-Play-Chat](https://www.modelscope.cn/studios/damo/role_play_chat/summary)\n\n\n## Spotlights\n\n\u003cimg src=\"assets/spotlights.jpg\" alt=\"spotlights\" width=\"80%\" /\u003e\n\nCompared with existed open-source models, we highlight three feaures of ChatPLUG as follows:\n\n1. **Knowledge Augmentation**\n\n  \u003e It's flexible to integrate external knowledge during inference, and this is an optional input. You can utilize a `search engine` to acquire up-to-date information or use a local knowledge base to obtain domain knowledge. \n\n2. **Personalization**\n\n  \u003e It's easy to customize the style of conversations and characters by setting `bot profiles` or using `role-paly instructions`.\n\n3. **Multi Skills** \n\n  \u003e It exhibits its proficiency in open-domain dialogue through mulit-turn conversation, while also displaying impressive `multi-task abilities` on a wide range of NLP tasks. \n\n\n## How to run\nWe offer three methods to use or continue developing ChatPLUG as follows:\n\n|  | Getting Started | Inference | Train | Deploy |\n|---|---|---|---|---|\n| ModelScope | Easy | :heavy_check_mark: Cli | :x:  Not Ready | :x:  Not Ready |\n| HuggingFace | Medium | :heavy_check_mark: Cli | :x: Not Ready | :x:  Not Ready |\n| XDPX | Hard | :heavy_check_mark: Cli | :heavy_check_mark:    Support | :heavy_check_mark: Serving |\n\n### ModelScope\nYou can download and use ChatPLUG models from ModelScope.\n\n| Model Name    | URL                                                          |\n| ------------- | ------------------------------------------------------------ |\n| ChatPLUG-240M | [ChatPLUG-开放域对话模型-240M](https://modelscope.cn/models/damo/ChatPLUG-240M/summary) |\n| ChatPLUG-3.7B | [ChatPLUG-开放域对话模型-3.7B](https://modelscope.cn/models/damo/ChatPLUG-3.7B/summary) |\n\n\n### HuggingFace\nComing soon.\n\n### XDPX\n\nXDPX is an easy-to-use library, that allows researchers and developers to train custom models and build own chatbots in a streamlined manner. Its all-in-one functionality allows for a one-stop solution that simplifies complex processes. [quick start](https://chatplug.readthedocs.io/zh_CN/latest/quick_start.html)\n\n#### One-Click Inference\n\n\u003e When using ChatPLUG-3.7B, you can set `core_chat_half_precision : true` to save memory.\n\n```bash\n# Requirement\n# in the dir of XDPX\ncd XDPX\npip install -e .\n\n# Download checkpoints\n# in the same dir as the download.sh\ncd ..\nsh download.sh\n\n# Inference\n# in the dir of XDPX\ncd XDPX\nCUDA_VISIBLE_DEVICES=0 x-script fidchat_new chat_pipeline/chatplug_3.7B_sftv2.6.0_instruction.hjson\n# input `#exit` and exit the terminal\n```\n\n#### One-Click Train\n\n\u003e If your GPU(e.g. A100、A10) support bf16, set `deepspeed_bf16: true` and `deepspeed_fp16: false`, otherwise set `deepspeed_bf16: false` and `deepspeed_fp16: true` \n\n```bash\n# 1. Download dataset from belle\n# in ChatPLUG/data/belle dir\ncd data/belle\ngit lfs install\ngit clone https://huggingface.co/datasets/BelleGroup/train_0.5M_CN\n\npython process_belle_0.5M.py \n# $ls data/belle \n# train_0.jsonl dev.jsonl ...\n\n# 2. Preprocess Data \n# in XDPX dir\nx-prepro chat_pipeline/chatplug_prepro_sft_instruction.hjson\n# $ls data/dialogue/sft/chatplug/belle_instruction \n# train_0.pt dev.pt\n\n# 3. Training\n# in XDPX dir\nx-train chat_pipeline/chatplug_3.7B_train_sftv2.6.0_instruction.hjson\n```\n\n\n#### One-Click Deploy \nComing soon.\n\n\n## Installation\n\nPlease refer to [Installation](https://chatplug.readthedocs.io/zh_CN/latest/quick_start.html) for installation instructions.\n\nFor detailed user guides, please refer to our [documentation](https://chatplug.readthedocs.io/zh_CN/latest):\n\n- User Guides\n  - [Quick Start](https://chatplug.readthedocs.io/zh_CN/latest/quick_start.html)\n  - [Retrieval](https://chatplug.readthedocs.io/zh_CN/latest/retrieval.html)\n  - [Role-Play](https://chatplug.readthedocs.io/zh_CN/latest/roleplay.html)\n\n- Advanced Guides\n  - [Intro](https://chatplug.readthedocs.io/zh_CN/latest/get_started.html)\n  - [Training](https://chatplug.readthedocs.io/zh_CN/latest/nlu_training.html#)\n  - [Develop](https://chatplug.readthedocs.io/zh_CN/latest/develop.html)\n  - [F.A.Q](https://chatplug.readthedocs.io/zh_CN/latest/faq.html)\n\n## Citations\n\nIf you find our project useful in your work, please cite:\n\n```\n  @misc{tian2023chatplug,\n        title={ChatPLUG: Open-Domain Generative Dialogue System with Internet-Augmented Instruction Tuning for Digital Human}, \n        author={Junfeng Tian and Hehong Chen and Guohai Xu and Ming Yan and Xing Gao and Jianhai Zhang and Chenliang Li and Jiayi Liu and Wenshen Xu and Haiyang Xu and Qi Qian and Wei Wang and Qinghao Ye and Jiejing Zhang and Ji Zhang and Fei Huang and Jingren Zhou},\n        year={2023},\n        eprint={2304.07849},\n        archivePrefix={arXiv},\n        primaryClass={cs.CL}\n  }\n```\n\n```\n@misc{plug2021,\n  title = {{PLUG: Pre-training for Language Understanding and Generation}},\n  author={ModelScope},\n  publisher = {ModelScope},\n  journal = {ModelScope repository},\n  year = {2021},\n  howpublished = {\\url{https://modelscope.cn/models/damo/nlp_plug_text-generation_27B/summary}},\n}\n```\n\n## License\nThis code is licensed under the [Apache License (Version 2.0). ](./LICENSE)\n","funding_links":[],"categories":["A01_文本生成_文本对话","Python"],"sub_categories":["大语言对话模型及数据"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FX-PLUG%2FChatPLUG","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FX-PLUG%2FChatPLUG","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FX-PLUG%2FChatPLUG/lists"}