vaclavkosar
commited on
Commit
β’
09f23bc
1
Parent(s):
9ff8898
Update README.md
Browse files
README.md
CHANGED
@@ -12,4 +12,170 @@ pipeline_tag: text-generation
|
|
12 |
# AWQ Quantization of Model Below
|
13 |
|
14 |
|
15 |
-
[openchat/openchat-3.6-8b-20240522](https://huggingface.co/openchat/openchat-3.6-8b-20240522/blob/main/README.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
# AWQ Quantization of Model Below
|
13 |
|
14 |
|
15 |
+
[openchat/openchat-3.6-8b-20240522](https://huggingface.co/openchat/openchat-3.6-8b-20240522/blob/main/README.md)
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
<div align="center">
|
22 |
+
<img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/logo_new.png" style="width: 65%">
|
23 |
+
<h1>Advancing Open-source Language Models with Mixed-Quality Data</h1>
|
24 |
+
</div>
|
25 |
+
|
26 |
+
<p align="center" style="margin-top: 0px;">
|
27 |
+
<a href="https://openchat.team">
|
28 |
+
<img src="https://github.com/alpayariyak/openchat/blob/master/assets/logo_nobg.png?raw=true" alt="OpenChat Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 10px; margin-top: 0px; margin-bottom: 0px;"/>
|
29 |
+
<span class="link-text" style=" margin-right: 5px;">Online Demo</span>
|
30 |
+
</a> |
|
31 |
+
<a href="https://github.com/imoneoi/openchat">
|
32 |
+
<img src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png" alt="GitHub Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
|
33 |
+
<span class="link-text" style=" margin-right: 5px;">GitHub</span>
|
34 |
+
</a> |
|
35 |
+
<a href="https://arxiv.org/pdf/2309.11235.pdf">
|
36 |
+
<img src="https://github.com/alpayariyak/openchat/blob/master/assets/arxiv-logomark-small-square-border.png?raw=true" alt="ArXiv Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
|
37 |
+
<span class="link-text" style="margin-right: 5px;">Paper</span>
|
38 |
+
</a> |
|
39 |
+
<a href="https://discord.gg/pQjnXvNKHY">
|
40 |
+
<img src="https://cloud.githubusercontent.com/assets/6291467/26705903/96c2d66e-477c-11e7-9f4e-f3c0efe96c9a.png" alt="Discord Logo" style="width:20px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
|
41 |
+
<span class="link-text">Discord</span>
|
42 |
+
</a>
|
43 |
+
</p>
|
44 |
+
|
45 |
+
<p align="center" style="margin-top: 0px;">
|
46 |
+
<span class="link-text" style=" margin-right: 0px; font-size: 0.8em">Sponsored by RunPod</span>
|
47 |
+
<img src="https://styles.redditmedia.com/t5_6075m3/styles/profileIcon_71syco7c5lt81.png?width=256&height=256&frame=1&auto=webp&crop=256:256,smart&s=24bd3c71dc11edc5d4f88d0cbc1da72ed7ae1969" alt="RunPod Logo" style="width:30px; vertical-align: middle; display: inline-block; margin-right: 5px; margin-left: 5px; margin-top: 0px; margin-bottom: 0px;"/>
|
48 |
+
</p>
|
49 |
+
|
50 |
+
<div style="background-color: white; padding: 0.7em; border-radius: 0.5em; color: black; display: flex; flex-direction: column; justify-content: center; text-align: center">
|
51 |
+
<a href="https://huggingface.co/openchat/openchat-3.5-0106" style="text-decoration: none; color: black;">
|
52 |
+
<span style="font-size: 1.7em; font-family: 'Helvetica'; letter-spacing: 0.1em; font-weight: bold; color: black;">Llama 3 Version: OPENCHAT</span><span style="font-size: 1.8em; font-family: 'Helvetica'; color: #3c72db; ">3.6</span>
|
53 |
+
<span style="font-size: 1.0em; font-family: 'Helvetica'; color: white; background-color: #90e0ef; vertical-align: top; border-radius: 6em; padding: 0.066em 0.4em; letter-spacing: 0.1em; font-weight: bold;">20240522</span>
|
54 |
+
<span style="font-size: 0.85em; font-family: 'Helvetica'; color: black;">
|
55 |
+
<br> π The Overall Best Performing Open-source 8B Model π
|
56 |
+
<br> π Outperforms Llama-3-8B-Instruct and open-source finetunes/merges π
|
57 |
+
</span>
|
58 |
+
</a>
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<div style="display: flex; justify-content: center; align-items: center; width: 110%; margin-left: -5%;">
|
62 |
+
<img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/benchmarks-openchat-3.6-20240522.svg" style="width: 100%; border-radius: 1em">
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div style="display: flex; justify-content: center; align-items: center">
|
66 |
+
<p>* Llama-3-Instruct often fails to follow the few-shot templates.</p>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<div align="center">
|
70 |
+
<h2> Usage </h2>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
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.
|
74 |
+
|
75 |
+
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.
|
76 |
+
|
77 |
+
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.
|
78 |
+
|
79 |
+
| Model | Size | Context | Weights | Serving |
|
80 |
+
|-----------------------|------|---------|-------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
|
81 |
+
| OpenChat-3.6-20240522 | 8B | 8192 | [Huggingface](https://huggingface.co/openchat/openchat-3.6-8b-20240522) | `python -m ochat.serving.openai_api_server --model openchat/openchat-3.6-8b-20240522` |
|
82 |
+
|
83 |
+
<details>
|
84 |
+
<summary>Example request (click to expand)</summary>
|
85 |
+
|
86 |
+
```bash
|
87 |
+
curl http://localhost:18888/v1/chat/completions \
|
88 |
+
-H "Content-Type: application/json" \
|
89 |
+
-d '{
|
90 |
+
"model": "openchat_3.6",
|
91 |
+
"messages": [{"role": "user", "content": "You are a large language model named OpenChat. Write a poem to describe yourself"}]
|
92 |
+
}'
|
93 |
+
```
|
94 |
+
|
95 |
+
</details>
|
96 |
+
|
97 |
+
### Conversation templates
|
98 |
+
|
99 |
+
π‘ **Default Mode**: Best for coding, chat and general tasks
|
100 |
+
|
101 |
+
```
|
102 |
+
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:
|
103 |
+
```
|
104 |
+
|
105 |
+
β οΈ **Notice:** Remember to set `<|end_of_turn|>` as end of generation token.
|
106 |
+
|
107 |
+
The default template is also available as the integrated `tokenizer.chat_template`, which can be used instead of manually specifying the template:
|
108 |
+
|
109 |
+
```python
|
110 |
+
messages = [
|
111 |
+
{"role": "user", "content": "Hello"},
|
112 |
+
{"role": "assistant", "content": "Hi"},
|
113 |
+
{"role": "user", "content": "How are you today?"}
|
114 |
+
]
|
115 |
+
tokens = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
|
116 |
+
```
|
117 |
+
|
118 |
+
## Inference using Transformers
|
119 |
+
|
120 |
+
```python
|
121 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
122 |
+
import torch
|
123 |
+
|
124 |
+
model_id = "openchat/openchat-3.6-8b-20240522"
|
125 |
+
|
126 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
127 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
|
128 |
+
|
129 |
+
messages = [
|
130 |
+
{"role": "user", "content": "Explain how large language models work in detail."},
|
131 |
+
]
|
132 |
+
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
133 |
+
|
134 |
+
outputs = model.generate(input_ids,
|
135 |
+
do_sample=True,
|
136 |
+
temperature=0.5,
|
137 |
+
max_new_tokens=1024
|
138 |
+
)
|
139 |
+
response = outputs[0][input_ids.shape[-1]:]
|
140 |
+
print(tokenizer.decode(response, skip_special_tokens=True))
|
141 |
+
```
|
142 |
+
|
143 |
+
<div align="center">
|
144 |
+
<h2> Limitations </h2>
|
145 |
+
</div>
|
146 |
+
|
147 |
+
**Foundation Model Limitations**
|
148 |
+
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:
|
149 |
+
|
150 |
+
- Complex reasoning
|
151 |
+
- Mathematical and arithmetic tasks
|
152 |
+
- Programming and coding challenges
|
153 |
+
|
154 |
+
**Hallucination of Non-existent Information**
|
155 |
+
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.
|
156 |
+
|
157 |
+
**Safety**
|
158 |
+
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.
|
159 |
+
|
160 |
+
<div align="center">
|
161 |
+
<h2> π Contact </h2>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
We look forward to hearing from you and collaborating on this exciting project!
|
165 |
+
|
166 |
+
**Project Lead:**
|
167 |
+
- Guan Wang [imonenext at gmail dot com]
|
168 |
+
- [Alpay Ariyak](https://github.com/alpayariyak) [aariyak at wpi dot edu]
|
169 |
+
|
170 |
+
<div align="center">
|
171 |
+
<h2> Citation </h2>
|
172 |
+
</div>
|
173 |
+
|
174 |
+
```
|
175 |
+
@article{wang2023openchat,
|
176 |
+
title={OpenChat: Advancing Open-source Language Models with Mixed-Quality Data},
|
177 |
+
author={Wang, Guan and Cheng, Sijie and Zhan, Xianyuan and Li, Xiangang and Song, Sen and Liu, Yang},
|
178 |
+
journal={arXiv preprint arXiv:2309.11235},
|
179 |
+
year={2023}
|
180 |
+
}
|
181 |
+
```
|