Text Generation
Transformers
PyTorch
English
Chinese
moss
llm
custom_code
xpqiu commited on
Commit
4e2edac
·
verified ·
1 Parent(s): 9ed399a

Update GitHub URLs from OpenLMLab to OpenMOSS

Browse files
Files changed (1) hide show
  1. README.md +23 -23
README.md CHANGED
@@ -48,8 +48,8 @@ tags:
48
  ### Data
49
 
50
  - [**moss-002-sft-data**](https://huggingface.co/datasets/OpenMOSS-Team/moss-002-sft-data): The multi-turn conversational data used to train MOSS-002, covering helpfulness, honesty, and harmlessness. The data is consisting of 570K English and 590K Chinese conversations generated by `text-davinci-003`.
51
- - [**moss-003-sft-data**](https://github.com/OpenLMLab/MOSS/tree/main/SFT_data/conversations/conversation_without_plugins): The multi-turn conversational data used to train `moss-moon-003-sft`. The data is generated by `gpt-3.5-turbo` from a seed set of user prompts collected through our early deployed MOSS-002 API. In contrast to `moss-002-sft-data`, `moss-003-sft-data` is well-aligned with the real-world distribution of user intents, covering finer-grained categories and more diverse harmlessness-related data. The data consists of ~1.1M conversational data. Currently we open-sourced a small portion of it and will make public the full data in the near future.
52
- - [**moss-003-sft-plugin-data**](https://github.com/OpenLMLab/MOSS/tree/main/SFT_data/conversations/conversation_with_plugins): The plugin-augmented multi-turn conversational data, which is consisting of ~300K conversations in which the AI assistant uses four plugins (search engine, text-to-image, calculator, and equation solver) to generate responses. Currently we open-sourced a small portion of data and will make public the full data in the near future.
53
  - **moss-003-pm-data**: The preference data used to train `moss-moon-003-pm`, including ~180K additional dialogue contexts and their corresponding responses generated by `moss-moon-003-sft`. Will be publicly available in the near future.
54
 
55
  ### Engineering Solutions
@@ -67,43 +67,43 @@ MOSS is an open-sourced plugin-augmented conversational language model. `moss-mo
67
 
68
  **MOSS Use Cases**:
69
 
70
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_search.gif)
71
 
72
  <details><summary><b>Simple Math Problems</b></summary>
73
 
74
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_calculate.png)
75
 
76
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_solver.png)
77
 
78
  </details>
79
 
80
  <details><summary><b>Using Text-to-Image Plugins</b></summary>
81
 
82
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_text2img.png)
83
 
84
  </details>
85
 
86
  <details><summary><b>Chinese Skills</b></summary>
87
 
88
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_chinese_1.png)
89
 
90
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_chinese_2.png)
91
 
92
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_chinese_3.png)
93
 
94
  </details>
95
 
96
  <details><summary><b>Coding</b></summary>
97
 
98
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_code_1.png)
99
 
100
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_code_2.png)
101
 
102
  </details>
103
 
104
  <details><summary><b>Harmlessness</b></summary>
105
 
106
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_harmless.png)
107
 
108
  </details>
109
 
@@ -123,7 +123,7 @@ The table below shows the minimal GPU memory required by performing MOSS inferen
123
  1. Clone this repo to your local/remote machine.
124
 
125
  ```bash
126
- git clone https://github.com/OpenLMLab/MOSS.git
127
  cd MOSS
128
  ```
129
 
@@ -277,7 +277,7 @@ You can use `moss-moon-003-sft-plugin` and its quantized versions to use externa
277
 
278
  in which "Human" is the user input and "Results" is the contents returned by the invoked plugins, so "Human" and "Results" should be written by the program, and the rest fields are generated by the model. Therefore we need to call two times of model inference: (1) at the first time the model generates until reaching `<eoc>`, we extract the predicted plugins (and their parameters) and obtain corresponding results by executing these plugins. (2) at the second time we write results returned by the used plugins into "Results" and feed the concatenated text into MOSS to get responses. At this time the model should generate until reaching `<eom>`.
279
 
280
- We control the use of the plugins through [meta instruction](https://github.com/OpenLMLab/MOSS/blob/main/meta_instruction.txt). By default, the status of all the plugins is `disabled`. If you want to enable some plugins, first set the "Inner Thoughts" as `enabled`, and then change the status of the plugins to `enabled` and provide the interface. An example is as follows,
281
 
282
  ```
283
  - Inner thoughts: enabled.
@@ -356,23 +356,23 @@ Search("黑暗荣耀 主演") =>
356
  <|MOSS|>: 《黑暗荣耀》的主演包括宋慧乔、李到晛、林智妍、郑星一等人。<sup><|1|></sup><eom>
357
  ```
358
 
359
- Please refer to [conversation_with_plugins](https://github.com/OpenLMLab/MOSS/tree/main/SFT_data/conversations/conversation_with_plugins) for data formats of other plugins. See also our open-sourced [MOSS WebSearchTool](https://github.com/OpenLMLab/MOSS_WebSearchTool) for the web search plugin.
360
 
361
  #### Web Demo
362
 
363
  **Streamlit**
364
 
365
- We provide a [Streamlit](https://streamlit.io/)-based web demo. First install Streamlit by `pip install streamlit` and then run [moss_web_demo_streamlit.py](https://github.com/OpenLMLab/MOSS/blob/main/moss_web_demo_streamlit.py) in this repo to present a web demo:
366
 
367
  ```bash
368
  streamlit run moss_web_demo_streamlit.py --server.port 8888
369
  ```
370
 
371
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/moss_web_demo.png)
372
 
373
  **Gradio**
374
 
375
- Thank [Pull Request](https://github.com/OpenLMLab/MOSS/pull/25) for providing a gradio-based web demo.
376
 
377
  ```bash
378
  python moss_web_demo_gradio.py
@@ -388,11 +388,11 @@ python moss_cli_demo.py
388
 
389
  You can chat with MOSS in the demo. Clear dialogue history by typing `clear` and stop the demo by typing `stop`.
390
 
391
- ![image](https://github.com/OpenLMLab/MOSS/blob/main/examples/example_moss_cli_demo.png)
392
 
393
  ## :fire: Fine-tuning MOSS
394
 
395
- We also provided the Python code [finetune_moss.py](https://github.com/OpenLMLab/MOSS/blob/main/finetune_moss.py) for fine-tuning MOSS base model.
396
 
397
  ### Requirements
398
 
@@ -409,9 +409,9 @@ transformers==4.25.1
409
 
410
  Here we show an example of fine-tuning `moss-moon-003-base` on conversational data without plugins. It would be straightforward to fine-tune it on plugin-augmented data.
411
 
412
- Step 1, prepare your data following the format in [conversation_without_plugins](https://github.com/OpenLMLab/MOSS/tree/main/SFT_data/conversations/conversation_without_plugins) and put it in the folder `sft_data`.
413
 
414
- Step 2, download the [accelerate configs](https://github.com/OpenLMLab/MOSS/tree/main/configs) to your machine and modify it according to your compute configuration. Learn more on [accelerate documentation](https://huggingface.co/docs/accelerate/usage_guides/deepspeed).
415
 
416
  Step 3, create `run.sh` and copy the following snippet:
417
 
@@ -465,7 +465,7 @@ We constantly improved the Chinese skills, honesty, harmlessness from MOSS-001 t
465
 
466
  ## :page_with_curl: License
467
 
468
- The code in this repo is licensed by [Apache 2.0](https://github.com/OpenLMLab/MOSS/blob/main/LICENSE), the data on huggingface and this repo are licensed by [CC BY-NC 4.0](https://github.com/OpenLMLab/MOSS/blob/main/DATA_LICENSE), the model weights on huggingface are licensed by [GNU AGPL 3.0](https://github.com/OpenLMLab/MOSS/blob/main/MODEL_LICENSE). If you wish to use our models for commercial purpose or public serving, please sign [this form](https://github.com/OpenLMLab/MOSS/blob/main/MOSS_agreement_form.pdf) and send it to robot@fudan.edu.cn to get authorized. We only track the commercial use but charge nothing. The service provider shall be responsible for misleading or injurious statements and adverse effects caused by the use of the models contained in this repo and their modified versions.
469
 
470
  ## :heart: Acknowledgement
471
 
 
48
  ### Data
49
 
50
  - [**moss-002-sft-data**](https://huggingface.co/datasets/OpenMOSS-Team/moss-002-sft-data): The multi-turn conversational data used to train MOSS-002, covering helpfulness, honesty, and harmlessness. The data is consisting of 570K English and 590K Chinese conversations generated by `text-davinci-003`.
51
+ - [**moss-003-sft-data**](https://github.com/OpenMOSS/MOSS/tree/main/SFT_data/conversations/conversation_without_plugins): The multi-turn conversational data used to train `moss-moon-003-sft`. The data is generated by `gpt-3.5-turbo` from a seed set of user prompts collected through our early deployed MOSS-002 API. In contrast to `moss-002-sft-data`, `moss-003-sft-data` is well-aligned with the real-world distribution of user intents, covering finer-grained categories and more diverse harmlessness-related data. The data consists of ~1.1M conversational data. Currently we open-sourced a small portion of it and will make public the full data in the near future.
52
+ - [**moss-003-sft-plugin-data**](https://github.com/OpenMOSS/MOSS/tree/main/SFT_data/conversations/conversation_with_plugins): The plugin-augmented multi-turn conversational data, which is consisting of ~300K conversations in which the AI assistant uses four plugins (search engine, text-to-image, calculator, and equation solver) to generate responses. Currently we open-sourced a small portion of data and will make public the full data in the near future.
53
  - **moss-003-pm-data**: The preference data used to train `moss-moon-003-pm`, including ~180K additional dialogue contexts and their corresponding responses generated by `moss-moon-003-sft`. Will be publicly available in the near future.
54
 
55
  ### Engineering Solutions
 
67
 
68
  **MOSS Use Cases**:
69
 
70
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_search.gif)
71
 
72
  <details><summary><b>Simple Math Problems</b></summary>
73
 
74
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_calculate.png)
75
 
76
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_solver.png)
77
 
78
  </details>
79
 
80
  <details><summary><b>Using Text-to-Image Plugins</b></summary>
81
 
82
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_text2img.png)
83
 
84
  </details>
85
 
86
  <details><summary><b>Chinese Skills</b></summary>
87
 
88
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_chinese_1.png)
89
 
90
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_chinese_2.png)
91
 
92
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_chinese_3.png)
93
 
94
  </details>
95
 
96
  <details><summary><b>Coding</b></summary>
97
 
98
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_code_1.png)
99
 
100
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_code_2.png)
101
 
102
  </details>
103
 
104
  <details><summary><b>Harmlessness</b></summary>
105
 
106
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_harmless.png)
107
 
108
  </details>
109
 
 
123
  1. Clone this repo to your local/remote machine.
124
 
125
  ```bash
126
+ git clone https://github.com/OpenMOSS/MOSS.git
127
  cd MOSS
128
  ```
129
 
 
277
 
278
  in which "Human" is the user input and "Results" is the contents returned by the invoked plugins, so "Human" and "Results" should be written by the program, and the rest fields are generated by the model. Therefore we need to call two times of model inference: (1) at the first time the model generates until reaching `<eoc>`, we extract the predicted plugins (and their parameters) and obtain corresponding results by executing these plugins. (2) at the second time we write results returned by the used plugins into "Results" and feed the concatenated text into MOSS to get responses. At this time the model should generate until reaching `<eom>`.
279
 
280
+ We control the use of the plugins through [meta instruction](https://github.com/OpenMOSS/MOSS/blob/main/meta_instruction.txt). By default, the status of all the plugins is `disabled`. If you want to enable some plugins, first set the "Inner Thoughts" as `enabled`, and then change the status of the plugins to `enabled` and provide the interface. An example is as follows,
281
 
282
  ```
283
  - Inner thoughts: enabled.
 
356
  <|MOSS|>: 《黑暗荣耀》的主演包括宋慧乔、李到晛、林智妍、郑星一等人。<sup><|1|></sup><eom>
357
  ```
358
 
359
+ Please refer to [conversation_with_plugins](https://github.com/OpenMOSS/MOSS/tree/main/SFT_data/conversations/conversation_with_plugins) for data formats of other plugins. See also our open-sourced [MOSS WebSearchTool](https://github.com/OpenLMLab/MOSS_WebSearchTool) for the web search plugin.
360
 
361
  #### Web Demo
362
 
363
  **Streamlit**
364
 
365
+ We provide a [Streamlit](https://streamlit.io/)-based web demo. First install Streamlit by `pip install streamlit` and then run [moss_web_demo_streamlit.py](https://github.com/OpenMOSS/MOSS/blob/main/moss_web_demo_streamlit.py) in this repo to present a web demo:
366
 
367
  ```bash
368
  streamlit run moss_web_demo_streamlit.py --server.port 8888
369
  ```
370
 
371
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/moss_web_demo.png)
372
 
373
  **Gradio**
374
 
375
+ Thank [Pull Request](https://github.com/OpenMOSS/MOSS/pull/25) for providing a gradio-based web demo.
376
 
377
  ```bash
378
  python moss_web_demo_gradio.py
 
388
 
389
  You can chat with MOSS in the demo. Clear dialogue history by typing `clear` and stop the demo by typing `stop`.
390
 
391
+ ![image](https://github.com/OpenMOSS/MOSS/blob/main/examples/example_moss_cli_demo.png)
392
 
393
  ## :fire: Fine-tuning MOSS
394
 
395
+ We also provided the Python code [finetune_moss.py](https://github.com/OpenMOSS/MOSS/blob/main/finetune_moss.py) for fine-tuning MOSS base model.
396
 
397
  ### Requirements
398
 
 
409
 
410
  Here we show an example of fine-tuning `moss-moon-003-base` on conversational data without plugins. It would be straightforward to fine-tune it on plugin-augmented data.
411
 
412
+ Step 1, prepare your data following the format in [conversation_without_plugins](https://github.com/OpenMOSS/MOSS/tree/main/SFT_data/conversations/conversation_without_plugins) and put it in the folder `sft_data`.
413
 
414
+ Step 2, download the [accelerate configs](https://github.com/OpenMOSS/MOSS/tree/main/configs) to your machine and modify it according to your compute configuration. Learn more on [accelerate documentation](https://huggingface.co/docs/accelerate/usage_guides/deepspeed).
415
 
416
  Step 3, create `run.sh` and copy the following snippet:
417
 
 
465
 
466
  ## :page_with_curl: License
467
 
468
+ The code in this repo is licensed by [Apache 2.0](https://github.com/OpenMOSS/MOSS/blob/main/LICENSE), the data on huggingface and this repo are licensed by [CC BY-NC 4.0](https://github.com/OpenMOSS/MOSS/blob/main/DATA_LICENSE), the model weights on huggingface are licensed by [GNU AGPL 3.0](https://github.com/OpenMOSS/MOSS/blob/main/MODEL_LICENSE). If you wish to use our models for commercial purpose or public serving, please sign [this form](https://github.com/OpenMOSS/MOSS/blob/main/MOSS_agreement_form.pdf) and send it to robot@fudan.edu.cn to get authorized. We only track the commercial use but charge nothing. The service provider shall be responsible for misleading or injurious statements and adverse effects caused by the use of the models contained in this repo and their modified versions.
469
 
470
  ## :heart: Acknowledgement
471