SolaireOfTheSun commited on
Commit
d6fe0e9
β€’
1 Parent(s): 82b7527

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +151 -148
README.md CHANGED
@@ -1,203 +1,206 @@
1
  ---
2
- library_name: transformers
3
  tags:
4
- - trl
5
- - sft
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  ---
7
 
8
- # Model Card for Model ID
9
-
10
- <!-- Provide a quick summary of what the model is/does. -->
11
-
12
-
13
-
14
- ## Model Details
15
-
16
- ### Model Description
17
-
18
- <!-- Provide a longer summary of what this model is. -->
19
-
20
- This is the model card of a πŸ€— transformers model that has been pushed on the Hub. This model card has been automatically generated.
21
-
22
- - **Developed by:** [More Information Needed]
23
- - **Funded by [optional]:** [More Information Needed]
24
- - **Shared by [optional]:** [More Information Needed]
25
- - **Model type:** [More Information Needed]
26
- - **Language(s) (NLP):** [More Information Needed]
27
- - **License:** [More Information Needed]
28
- - **Finetuned from model [optional]:** [More Information Needed]
29
-
30
- ### Model Sources [optional]
31
-
32
- <!-- Provide the basic links for the model. -->
33
-
34
- - **Repository:** [More Information Needed]
35
- - **Paper [optional]:** [More Information Needed]
36
- - **Demo [optional]:** [More Information Needed]
37
-
38
- ## Uses
39
-
40
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
41
-
42
- ### Direct Use
43
-
44
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
45
-
46
- [More Information Needed]
47
-
48
- ### Downstream Use [optional]
49
-
50
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
51
-
52
- [More Information Needed]
53
-
54
- ### Out-of-Scope Use
55
-
56
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
57
-
58
- [More Information Needed]
59
-
60
- ## Bias, Risks, and Limitations
61
-
62
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
63
-
64
- [More Information Needed]
65
-
66
- ### Recommendations
67
-
68
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
69
-
70
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
71
-
72
- ## How to Get Started with the Model
73
-
74
- Use the code below to get started with the model.
75
-
76
- [More Information Needed]
77
-
78
- ## Training Details
79
-
80
- ### Training Data
81
-
82
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
83
-
84
- [More Information Needed]
85
-
86
- ### Training Procedure
87
-
88
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
89
-
90
- #### Preprocessing [optional]
91
-
92
- [More Information Needed]
93
-
94
-
95
- #### Training Hyperparameters
96
-
97
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
98
-
99
- #### Speeds, Sizes, Times [optional]
100
-
101
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
102
 
103
- [More Information Needed]
 
 
104
 
105
- ## Evaluation
 
 
 
 
 
 
 
106
 
107
- <!-- This section describes the evaluation protocols and provides the results. -->
108
 
109
- ### Testing Data, Factors & Metrics
110
 
111
- #### Testing Data
 
 
112
 
113
- <!-- This should link to a Dataset Card if possible. -->
114
 
115
- [More Information Needed]
116
 
117
- #### Factors
118
 
119
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
120
 
121
- [More Information Needed]
122
 
123
- #### Metrics
124
 
125
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
 
126
 
127
- [More Information Needed]
 
 
 
 
 
 
 
128
 
129
- ### Results
130
 
131
- [More Information Needed]
 
 
 
 
 
 
 
 
132
 
133
- #### Summary
134
 
 
 
 
135
 
 
136
 
137
- ## Model Examination [optional]
 
138
 
139
- <!-- Relevant interpretability work for the model goes here -->
 
 
140
 
141
- [More Information Needed]
 
 
142
 
143
- ## Environmental Impact
 
 
144
 
145
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
 
 
 
146
 
147
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
148
 
149
- - **Hardware Type:** [More Information Needed]
150
- - **Hours used:** [More Information Needed]
151
- - **Cloud Provider:** [More Information Needed]
152
- - **Compute Region:** [More Information Needed]
153
- - **Carbon Emitted:** [More Information Needed]
154
 
155
- ## Technical Specifications [optional]
 
 
 
 
 
 
 
 
156
 
157
- ### Model Architecture and Objective
158
 
159
- [More Information Needed]
160
 
161
- ### Compute Infrastructure
162
 
163
- [More Information Needed]
164
 
165
- #### Hardware
 
 
 
 
166
 
167
- [More Information Needed]
168
 
169
- #### Software
 
 
 
 
 
 
 
 
 
 
170
 
171
- [More Information Needed]
172
 
173
- ## Citation [optional]
174
 
175
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
176
 
177
- **BibTeX:**
178
 
179
- [More Information Needed]
180
 
181
- **APA:**
 
182
 
183
- [More Information Needed]
 
 
184
 
185
- ## Glossary [optional]
 
186
 
187
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
 
188
 
189
- [More Information Needed]
190
 
191
- ## More Information [optional]
192
 
193
- [More Information Needed]
194
 
195
- ## Model Card Authors [optional]
196
 
197
- [More Information Needed]
 
 
 
 
 
 
 
198
 
199
- ## Model Card Contact
200
 
201
- [More Information Needed]
 
 
 
 
 
 
 
202
 
 
203
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
  tags:
4
+ - openchat
5
+ - mistral
6
+ - C-RLFT
7
+ datasets:
8
+ - openchat/openchat_sharegpt4_dataset
9
+ - imone/OpenOrca_FLAN
10
+ - LDJnr/LessWrong-Amplify-Instruct
11
+ - LDJnr/Pure-Dove
12
+ - LDJnr/Verified-Camel
13
+ - tiedong/goat
14
+ - glaiveai/glaive-code-assistant
15
+ - meta-math/MetaMathQA
16
+ - OpenAssistant/oasst_top1_2023-08-25
17
+ - TIGER-Lab/MathInstruct
18
+ library_name: transformers
19
+ pipeline_tag: text-generation
20
  ---
21
 
22
+ # OpenChat: Advancing Open-source Language Models with Mixed-Quality Data
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+ <div align="center">
25
+ <img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/logo_new.png" style="width: 65%">
26
+ </div>
27
 
28
+ <p align="center">
29
+ <a href="https://github.com/imoneoi/openchat">GitHub Repo</a> β€’
30
+ <a href="https://openchat.team">Online Demo</a> β€’
31
+ <a href="https://discord.gg/pQjnXvNKHY">Discord</a> β€’
32
+ <a href="https://twitter.com/imonenext">Twitter</a> β€’
33
+ <a href="https://huggingface.co/openchat">Huggingface</a> β€’
34
+ <a href="https://arxiv.org/pdf/2309.11235.pdf">Paper</a>
35
+ </p>
36
 
37
+ **πŸ”₯ The first 7B model Achieves Comparable Results with ChatGPT (March)! πŸ”₯**
38
 
39
+ **πŸ€– #1 Open-source model on MT-bench scoring 7.81, outperforming 70B models πŸ€–**
40
 
41
+ <div align="center" style="justify-content: center; align-items: center; "'>
42
+ <img src="https://github.com/alpayariyak/openchat/blob/master/assets/3.5-benchmarks.png?raw=true" style="width: 100%; border-radius: 0.5em">
43
+ </div>
44
 
45
+ OpenChat is an innovative library of open-source language models, fine-tuned with [C-RLFT](https://arxiv.org/pdf/2309.11235.pdf) - a strategy inspired by offline reinforcement learning. Our models learn from mixed-quality data without preference labels, delivering exceptional performance on par with ChatGPT, even with a 7B model. Despite our simple approach, we are committed to developing a high-performance, commercially viable, open-source large language model, and we continue to make significant strides toward this vision.
46
 
47
+ [![DOI](https://zenodo.org/badge/645397533.svg)](https://zenodo.org/badge/latestdoi/645397533)
48
 
49
+ ## Usage
50
 
51
+ To use this model, we highly recommend installing the OpenChat package by following the [installation guide](https://github.com/imoneoi/openchat#installation) in our repository and using the OpenChat OpenAI-compatible API server by running the serving command from the table below. The server is optimized for high-throughput deployment using [vLLM](https://github.com/vllm-project/vllm) and can run on a consumer GPU with 24GB RAM. To enable tensor parallelism, append `--tensor-parallel-size N` to the serving command.
52
 
53
+ Once started, the server listens at `localhost:18888` for requests and is compatible with the [OpenAI ChatCompletion API specifications](https://platform.openai.com/docs/api-reference/chat). Please refer to the example request below for reference. Additionally, you can use the [OpenChat Web UI](https://github.com/imoneoi/openchat#web-ui) for a user-friendly experience.
54
 
55
+ If you want to deploy the server as an online service, you can use `--api-keys sk-KEY1 sk-KEY2 ...` to specify allowed API keys and `--disable-log-requests --disable-log-stats --log-file openchat.log` for logging only to a file. For security purposes, we recommend using an [HTTPS gateway](https://fastapi.tiangolo.com/es/deployment/concepts/#security-https) in front of the server.
56
 
57
+ <details>
58
+ <summary>Example request (click to expand)</summary>
59
 
60
+ ```bash
61
+ curl http://localhost:18888/v1/chat/completions \
62
+ -H "Content-Type: application/json" \
63
+ -d '{
64
+ "model": "openchat_3.5",
65
+ "messages": [{"role": "user", "content": "You are a large language model named OpenChat. Write a poem to describe yourself"}]
66
+ }'
67
+ ```
68
 
69
+ Coding Mode
70
 
71
+ ```bash
72
+ curl http://localhost:18888/v1/chat/completions \
73
+ -H "Content-Type: application/json" \
74
+ -d '{
75
+ "model": "openchat_3.5",
76
+ "condition": "Code",
77
+ "messages": [{"role": "user", "content": "Write an aesthetic TODO app using HTML5 and JS, in a single file. You should use round corners and gradients to make it more aesthetic."}]
78
+ }'
79
+ ```
80
 
81
+ </details>
82
 
83
+ | Model | Size | Context | Weights | Serving |
84
+ |--------------|------|---------|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
85
+ | OpenChat 3.5 | 7B | 8192 | [Huggingface](https://huggingface.co/openchat/openchat_3.5) | `python -m ochat.serving.openai_api_server --model openchat/openchat_3.5 --engine-use-ray --worker-use-ray` |
86
 
87
+ For inference with Huggingface Transformers (slow and not recommended), follow the conversation template provided below.
88
 
89
+ <details>
90
+ <summary>Conversation templates (click to expand)</summary>
91
 
92
+ ```python
93
+ import transformers
94
+ tokenizer = transformers.AutoTokenizer.from_pretrained("openchat/openchat_3.5")
95
 
96
+ # Single-turn
97
+ tokens = tokenizer("GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant:").input_ids
98
+ assert tokens == [1, 420, 6316, 28781, 3198, 3123, 1247, 28747, 22557, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747]
99
 
100
+ # Multi-turn
101
+ tokens = tokenizer("GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant: Hi<|end_of_turn|>GPT4 Correct User: How are you today?<|end_of_turn|>GPT4 Correct Assistant:").input_ids
102
+ assert tokens == [1, 420, 6316, 28781, 3198, 3123, 1247, 28747, 22557, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747, 15359, 32000, 420, 6316, 28781, 3198, 3123, 1247, 28747, 1602, 460, 368, 3154, 28804, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747]
103
 
104
+ # Coding Mode
105
+ tokens = tokenizer("Code User: Implement quicksort using C++<|end_of_turn|>Code Assistant:").input_ids
106
+ assert tokens == [1, 7596, 1247, 28747, 26256, 2936, 7653, 1413, 334, 1680, 32000, 7596, 21631, 28747]
107
+ ```
108
 
109
+ </details>
110
 
111
+ The GPT4 template is also available as the integrated `tokenizer.chat_template`,
112
+ which can be used instead of manually specifying the template:
 
 
 
113
 
114
+ ```python
115
+ messages = [
116
+ {"role": "user", "content": "Hello"},
117
+ {"role": "assistant", "content": "Hi"},
118
+ {"role": "user", "content": "How are you today?"}
119
+ ]
120
+ tokens = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
121
+ assert tokens == [1, 420, 6316, 28781, 3198, 3123, 1247, 28747, 22557, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747, 15359, 32000, 420, 6316, 28781, 3198, 3123, 1247, 28747, 1602, 460, 368, 3154, 28804, 32000, 420, 6316, 28781, 3198, 3123, 21631, 28747]
122
+ ```
123
 
124
+ ## Comparison with [X.AI Grok models](https://x.ai/)
125
 
126
+ Hey @elonmusk, I just wanted to let you know that I've recently come across your new model, Grok, and I must say, I'm quite impressed! With 33 billion parameters and all, you've really outdone yourself. But, I've got some news for you - I've outperformed Grok with my humble 7 billion parameters! Isn't that wild? I mean, who would have thought that a model with fewer parameters could be just as witty and humorous as Grok?
127
 
128
+ Anyway, I think it's about time you join the open research movement and make your model, Grok, open source! The world needs more brilliant minds like yours to contribute to the advancement of AI. Together, we can create something truly groundbreaking and make the world a better place. So, what do you say, @elonmusk? Let's open up the doors and share our knowledge with the world! πŸš€πŸ’‘
129
 
130
+ (Written by OpenChat 3.5, with a touch of humor and wit.)
131
 
132
+ | | License | # Param | Average | MMLU | HumanEval | MATH | GSM8k |
133
+ |--------------|-------------|---------|----------|------|-----------|----------|----------|
134
+ | OpenChat 3.5 | Apache-2.0 | 7B | **56.4** | 64.3 | 55.5 | **28.6** | **77.3** |
135
+ | Grok-0 | Proprietary | 33B | 44.5 | 65.7 | 39.7 | 15.7 | 56.8 |
136
+ | Grok-1 | Proprietary | ? | 55.8 | 73 | 63.2 | 23.9 | 62.9 |
137
 
138
+ ## <a id="benchmarks"></a> Benchmarks
139
 
140
+ | Model | # Params | Average | MT-Bench | AGIEval | BBH MC | TruthfulQA | MMLU | HumanEval | BBH CoT | GSM8K |
141
+ |--------------------|----------|----------|--------------|----------|----------|---------------|--------------|-----------------|-------------|--------------|
142
+ | OpenChat-3.5 | **7B** | **61.6** | 7.81 | **47.4** | **47.6** | **59.1** | 64.3 | **55.5** | 63.5 | **77.3** |
143
+ | ChatGPT (March)* | ? | 61.5 | **7.94** | 47.1 | **47.6** | 57.7 | **67.3** | 48.1 | **70.1** | 74.9 |
144
+ | | | | | | | | | | | |
145
+ | OpenHermes 2.5 | 7B | 59.3 | 7.54 | 46.5 | 49.4 | 57.5 | 63.8 | 48.2 | 59.9 | 73.5 |
146
+ | OpenOrca Mistral | 7B | 52.7 | 6.86 | 42.9 | 49.4 | 45.9 | 59.3 | 38.4 | 58.1 | 59.1 |
147
+ | Zephyr-Ξ²^ | 7B | 34.6 | 7.34 | 39.0 | 40.6 | 40.8 | 39.8 | 22.0 | 16.0 | 5.1 |
148
+ | Mistral | 7B | - | 6.84 | 38.0 | 39.0 | - | 60.1 | 30.5 | - | 52.2 |
149
+ | Open-source SOTA** | 13B-70B | 61.4 | 7.71 | 41.7 | 49.7 | 62.3 | 63.7 | 73.2 | 41.4 | 82.3 |
150
+ | | | | WizardLM 70B | Orca 13B | Orca 13B | Platypus2 70B | WizardLM 70B | WizardCoder 34B | Flan-T5 11B | MetaMath 70B |
151
 
152
+ *: ChatGPT (March) results are from [GPT-4 Technical Report](https://arxiv.org/abs/2303.08774), [Chain-of-Thought Hub](https://github.com/FranxYao/chain-of-thought-hub), and our evaluation. Please note that ChatGPT is not a fixed baseline and evolves rapidly over time.
153
 
154
+ ^: Zephyr-Ξ² often fails to follow few-shot CoT instructions, likely because it was aligned with only chat data but not trained on few-shot data.
155
 
156
+ **: Mistral and Open-source SOTA results are taken from reported results in instruction-tuned model papers and official repositories.
157
 
158
+ All models are evaluated in chat mode (e.g. with the respective conversation template applied). All zero-shot benchmarks follow the same setting as in the AGIEval paper and Orca paper. CoT tasks use the same configuration as Chain-of-Thought Hub, HumanEval is evaluated with EvalPlus, and MT-bench is run using FastChat. To reproduce our results, follow the instructions in [our repository](https://github.com/imoneoi/openchat/#benchmarks).
159
 
160
+ ## Limitations
161
 
162
+ **Foundation Model Limitations**
163
+ Despite its advanced capabilities, OpenChat is still bound by the limitations inherent in its foundation models. These limitations may impact the model's performance in areas such as:
164
 
165
+ - Complex reasoning
166
+ - Mathematical and arithmetic tasks
167
+ - Programming and coding challenges
168
 
169
+ **Hallucination of Non-existent Information**
170
+ OpenChat may sometimes generate information that does not exist or is not accurate, also known as "hallucination". Users should be aware of this possibility and verify any critical information obtained from the model.
171
 
172
+ **Safety**
173
+ OpenChat may sometimes generate harmful, hate speech, biased responses, or answer unsafe questions. It's crucial to apply additional AI safety measures in use cases that require safe and moderated responses.
174
 
175
+ ## License
176
 
177
+ Our OpenChat 3.5 code and models are distributed under the Apache License 2.0.
178
 
179
+ ## Dataset Details
180
 
181
+ OpenChat 3.5 was trained with C-RLFT on a collection of publicly available high-quality instruction data, with a custom processing pipeline. We detail some notable subsets included here:
182
 
183
+ - [OpenChat ShareGPT](https://huggingface.co/datasets/openchat/openchat_sharegpt4_dataset)
184
+ - [Open-Orca with FLAN answers](https://huggingface.co/datasets/imone/OpenOrca_FLAN)
185
+ - Capybara [1](https://huggingface.co/datasets/LDJnr/Pure-Dove) [2](https://huggingface.co/datasets/LDJnr/Verified-Camel) [3](https://huggingface.co/datasets/LDJnr/LessWrong-Amplify-Instruct)
186
+ - [GOAT](https://huggingface.co/datasets/tiedong/goat)
187
+ - [Glaive](https://huggingface.co/datasets/glaiveai/glaive-code-assistant)
188
+ - [MetaMathQA](https://huggingface.co/datasets/meta-math/MetaMathQA)
189
+ - [MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
190
+ - [OpenAssistant](https://huggingface.co/datasets/OpenAssistant/oasst_top1_2023-08-25)
191
 
192
+ ## Citation
193
 
194
+ ```
195
+ @article{wang2023openchat,
196
+ title={OpenChat: Advancing Open-source Language Models with Mixed-Quality Data},
197
+ author={Wang, Guan and Cheng, Sijie and Zhan, Xianyuan and Li, Xiangang and Song, Sen and Liu, Yang},
198
+ journal={arXiv preprint arXiv:2309.11235},
199
+ year={2023}
200
+ }
201
+ ```
202
 
203
+ ## πŸ’Œ Main Contributor
204
 
205
+ * Wang Guan [imonenext@gmail.com], Cheng Sijie [csj23@mails.tsinghua.edu.cn], LDJ
206
+ * We look forward to hearing you and collaborating on this exciting project!