Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,396 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: chargoddard/rpguild-chatml-13b
|
3 |
+
datasets:
|
4 |
+
- chargoddard/rpguild
|
5 |
+
inference: false
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
license: cc-by-nc-4.0
|
9 |
+
model_creator: Charles Goddard
|
10 |
+
model_name: RPGuild ChatML 13B
|
11 |
+
model_type: llama
|
12 |
+
prompt_template: '<|im_start|>system
|
13 |
+
|
14 |
+
{system_message}<|im_end|>
|
15 |
+
|
16 |
+
<|im_start|>user
|
17 |
+
|
18 |
+
{prompt}<|im_end|>
|
19 |
+
|
20 |
+
<|im_start|>assistant
|
21 |
+
|
22 |
+
'
|
23 |
+
quantized_by: TheBloke
|
24 |
+
tags:
|
25 |
+
- llama
|
26 |
+
- roleplay
|
27 |
+
---
|
28 |
+
<!-- markdownlint-disable MD041 -->
|
29 |
+
|
30 |
+
<!-- header start -->
|
31 |
+
<!-- 200823 -->
|
32 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
33 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
34 |
+
</div>
|
35 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
36 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
37 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
38 |
+
</div>
|
39 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
40 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
<div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
|
44 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
45 |
+
<!-- header end -->
|
46 |
+
|
47 |
+
# RPGuild ChatML 13B - GPTQ
|
48 |
+
- Model creator: [Charles Goddard](https://huggingface.co/chargoddard)
|
49 |
+
- Original model: [RPGuild ChatML 13B](https://huggingface.co/chargoddard/rpguild-chatml-13b)
|
50 |
+
|
51 |
+
<!-- description start -->
|
52 |
+
## Description
|
53 |
+
|
54 |
+
This repo contains GPTQ model files for [Charles Goddard's RPGuild ChatML 13B](https://huggingface.co/chargoddard/rpguild-chatml-13b).
|
55 |
+
|
56 |
+
Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
|
57 |
+
|
58 |
+
<!-- description end -->
|
59 |
+
<!-- repositories-available start -->
|
60 |
+
## Repositories available
|
61 |
+
|
62 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/rpguild-chatml-13B-AWQ)
|
63 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ)
|
64 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/rpguild-chatml-13B-GGUF)
|
65 |
+
* [Charles Goddard's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/chargoddard/rpguild-chatml-13b)
|
66 |
+
<!-- repositories-available end -->
|
67 |
+
|
68 |
+
<!-- prompt-template start -->
|
69 |
+
## Prompt template: ChatML
|
70 |
+
|
71 |
+
```
|
72 |
+
<|im_start|>system
|
73 |
+
{system_message}<|im_end|>
|
74 |
+
<|im_start|>user
|
75 |
+
{prompt}<|im_end|>
|
76 |
+
<|im_start|>assistant
|
77 |
+
|
78 |
+
```
|
79 |
+
|
80 |
+
<!-- prompt-template end -->
|
81 |
+
<!-- licensing start -->
|
82 |
+
## Licensing
|
83 |
+
|
84 |
+
The creator of the source model has listed its license as `cc-by-nc-4.0`, and this quantization has therefore used that same license.
|
85 |
+
|
86 |
+
As this model is based on Llama 2, it is also subject to the Meta Llama 2 license terms, and the license files for that are additionally included. It should therefore be considered as being claimed to be licensed under both licenses. I contacted Hugging Face for clarification on dual licensing but they do not yet have an official position. Should this change, or should Meta provide any feedback on this situation, I will update this section accordingly.
|
87 |
+
|
88 |
+
In the meantime, any questions regarding licensing, and in particular how these two licenses might interact, should be directed to the original model repository: [Charles Goddard's RPGuild ChatML 13B](https://huggingface.co/chargoddard/rpguild-chatml-13b).
|
89 |
+
<!-- licensing end -->
|
90 |
+
<!-- README_GPTQ.md-provided-files start -->
|
91 |
+
## Provided files, and GPTQ parameters
|
92 |
+
|
93 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
94 |
+
|
95 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
96 |
+
|
97 |
+
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
|
98 |
+
|
99 |
+
<details>
|
100 |
+
<summary>Explanation of GPTQ parameters</summary>
|
101 |
+
|
102 |
+
- Bits: The bit size of the quantised model.
|
103 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
104 |
+
- Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
|
105 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
106 |
+
- GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
|
107 |
+
- Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
|
108 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
|
109 |
+
|
110 |
+
</details>
|
111 |
+
|
112 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
113 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
114 |
+
| [main](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.26 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
115 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.00 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
116 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.36 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
|
117 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 13.65 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
118 |
+
| [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 14.55 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
|
119 |
+
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.51 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
|
120 |
+
|
121 |
+
<!-- README_GPTQ.md-provided-files end -->
|
122 |
+
|
123 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
124 |
+
## How to download, including from branches
|
125 |
+
|
126 |
+
### In text-generation-webui
|
127 |
+
|
128 |
+
To download from the `main` branch, enter `TheBloke/rpguild-chatml-13B-GPTQ` in the "Download model" box.
|
129 |
+
|
130 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/rpguild-chatml-13B-GPTQ:gptq-4bit-32g-actorder_True`
|
131 |
+
|
132 |
+
### From the command line
|
133 |
+
|
134 |
+
I recommend using the `huggingface-hub` Python library:
|
135 |
+
|
136 |
+
```shell
|
137 |
+
pip3 install huggingface-hub
|
138 |
+
```
|
139 |
+
|
140 |
+
To download the `main` branch to a folder called `rpguild-chatml-13B-GPTQ`:
|
141 |
+
|
142 |
+
```shell
|
143 |
+
mkdir rpguild-chatml-13B-GPTQ
|
144 |
+
huggingface-cli download TheBloke/rpguild-chatml-13B-GPTQ --local-dir rpguild-chatml-13B-GPTQ --local-dir-use-symlinks False
|
145 |
+
```
|
146 |
+
|
147 |
+
To download from a different branch, add the `--revision` parameter:
|
148 |
+
|
149 |
+
```shell
|
150 |
+
mkdir rpguild-chatml-13B-GPTQ
|
151 |
+
huggingface-cli download TheBloke/rpguild-chatml-13B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir rpguild-chatml-13B-GPTQ --local-dir-use-symlinks False
|
152 |
+
```
|
153 |
+
|
154 |
+
<details>
|
155 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
156 |
+
|
157 |
+
If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Huggingface cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
|
158 |
+
|
159 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
160 |
+
|
161 |
+
For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
|
162 |
+
|
163 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
164 |
+
|
165 |
+
```shell
|
166 |
+
pip3 install hf_transfer
|
167 |
+
```
|
168 |
+
|
169 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
170 |
+
|
171 |
+
```shell
|
172 |
+
mkdir rpguild-chatml-13B-GPTQ
|
173 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/rpguild-chatml-13B-GPTQ --local-dir rpguild-chatml-13B-GPTQ --local-dir-use-symlinks False
|
174 |
+
```
|
175 |
+
|
176 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
177 |
+
</details>
|
178 |
+
|
179 |
+
### With `git` (**not** recommended)
|
180 |
+
|
181 |
+
To clone a specific branch with `git`, use a command like this:
|
182 |
+
|
183 |
+
```shell
|
184 |
+
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/rpguild-chatml-13B-GPTQ
|
185 |
+
```
|
186 |
+
|
187 |
+
Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
|
188 |
+
|
189 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
190 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
191 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
192 |
+
|
193 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
194 |
+
|
195 |
+
It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
|
196 |
+
|
197 |
+
1. Click the **Model tab**.
|
198 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/rpguild-chatml-13B-GPTQ`.
|
199 |
+
|
200 |
+
- To download from a specific branch, enter for example `TheBloke/rpguild-chatml-13B-GPTQ:gptq-4bit-32g-actorder_True`
|
201 |
+
- see Provided Files above for the list of branches for each option.
|
202 |
+
|
203 |
+
3. Click **Download**.
|
204 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
205 |
+
5. In the top left, click the refresh icon next to **Model**.
|
206 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `rpguild-chatml-13B-GPTQ`
|
207 |
+
7. The model will automatically load, and is now ready for use!
|
208 |
+
8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
|
209 |
+
|
210 |
+
- Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
|
211 |
+
|
212 |
+
9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
|
213 |
+
|
214 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
215 |
+
|
216 |
+
<!-- README_GPTQ.md-use-from-tgi start -->
|
217 |
+
## Serving this model from Text Generation Inference (TGI)
|
218 |
+
|
219 |
+
It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
|
220 |
+
|
221 |
+
Example Docker parameters:
|
222 |
+
|
223 |
+
```shell
|
224 |
+
--model-id TheBloke/rpguild-chatml-13B-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
|
225 |
+
```
|
226 |
+
|
227 |
+
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
|
228 |
+
|
229 |
+
```shell
|
230 |
+
pip3 install huggingface-hub
|
231 |
+
```
|
232 |
+
|
233 |
+
```python
|
234 |
+
from huggingface_hub import InferenceClient
|
235 |
+
|
236 |
+
endpoint_url = "https://your-endpoint-url-here"
|
237 |
+
|
238 |
+
prompt = "Tell me about AI"
|
239 |
+
prompt_template=f'''<|im_start|>system
|
240 |
+
{system_message}<|im_end|>
|
241 |
+
<|im_start|>user
|
242 |
+
{prompt}<|im_end|>
|
243 |
+
<|im_start|>assistant
|
244 |
+
'''
|
245 |
+
|
246 |
+
client = InferenceClient(endpoint_url)
|
247 |
+
response = client.text_generation(prompt,
|
248 |
+
max_new_tokens=128,
|
249 |
+
do_sample=True,
|
250 |
+
temperature=0.7,
|
251 |
+
top_p=0.95,
|
252 |
+
top_k=40,
|
253 |
+
repetition_penalty=1.1)
|
254 |
+
|
255 |
+
print(f"Model output: {response}")
|
256 |
+
```
|
257 |
+
<!-- README_GPTQ.md-use-from-tgi end -->
|
258 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
259 |
+
## How to use this GPTQ model from Python code
|
260 |
+
|
261 |
+
### Install the necessary packages
|
262 |
+
|
263 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
264 |
+
|
265 |
+
```shell
|
266 |
+
pip3 install transformers optimum
|
267 |
+
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
268 |
+
```
|
269 |
+
|
270 |
+
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
271 |
+
|
272 |
+
```shell
|
273 |
+
pip3 uninstall -y auto-gptq
|
274 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
275 |
+
cd AutoGPTQ
|
276 |
+
git checkout v0.4.2
|
277 |
+
pip3 install .
|
278 |
+
```
|
279 |
+
|
280 |
+
### You can then use the following code
|
281 |
+
|
282 |
+
```python
|
283 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
284 |
+
|
285 |
+
model_name_or_path = "TheBloke/rpguild-chatml-13B-GPTQ"
|
286 |
+
# To use a different branch, change revision
|
287 |
+
# For example: revision="gptq-4bit-32g-actorder_True"
|
288 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
289 |
+
device_map="auto",
|
290 |
+
trust_remote_code=False,
|
291 |
+
revision="main")
|
292 |
+
|
293 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
294 |
+
|
295 |
+
prompt = "Tell me about AI"
|
296 |
+
prompt_template=f'''<|im_start|>system
|
297 |
+
{system_message}<|im_end|>
|
298 |
+
<|im_start|>user
|
299 |
+
{prompt}<|im_end|>
|
300 |
+
<|im_start|>assistant
|
301 |
+
'''
|
302 |
+
|
303 |
+
print("\n\n*** Generate:")
|
304 |
+
|
305 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
306 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
307 |
+
print(tokenizer.decode(output[0]))
|
308 |
+
|
309 |
+
# Inference can also be done using transformers' pipeline
|
310 |
+
|
311 |
+
print("*** Pipeline:")
|
312 |
+
pipe = pipeline(
|
313 |
+
"text-generation",
|
314 |
+
model=model,
|
315 |
+
tokenizer=tokenizer,
|
316 |
+
max_new_tokens=512,
|
317 |
+
do_sample=True,
|
318 |
+
temperature=0.7,
|
319 |
+
top_p=0.95,
|
320 |
+
top_k=40,
|
321 |
+
repetition_penalty=1.1
|
322 |
+
)
|
323 |
+
|
324 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
325 |
+
```
|
326 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
327 |
+
|
328 |
+
<!-- README_GPTQ.md-compatibility start -->
|
329 |
+
## Compatibility
|
330 |
+
|
331 |
+
The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).
|
332 |
+
|
333 |
+
[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
|
334 |
+
|
335 |
+
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
|
336 |
+
<!-- README_GPTQ.md-compatibility end -->
|
337 |
+
|
338 |
+
<!-- footer start -->
|
339 |
+
<!-- 200823 -->
|
340 |
+
## Discord
|
341 |
+
|
342 |
+
For further support, and discussions on these models and AI in general, join us at:
|
343 |
+
|
344 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
345 |
+
|
346 |
+
## Thanks, and how to contribute
|
347 |
+
|
348 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
349 |
+
|
350 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
351 |
+
|
352 |
+
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
|
353 |
+
|
354 |
+
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
|
355 |
+
|
356 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
357 |
+
|
358 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
359 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
360 |
+
|
361 |
+
**Special thanks to**: Aemon Algiz.
|
362 |
+
|
363 |
+
**Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
|
364 |
+
|
365 |
+
|
366 |
+
Thank you to all my generous patrons and donaters!
|
367 |
+
|
368 |
+
And thank you again to a16z for their generous grant.
|
369 |
+
|
370 |
+
<!-- footer end -->
|
371 |
+
|
372 |
+
# Original model card: Charles Goddard's RPGuild ChatML 13B
|
373 |
+
|
374 |
+
|
375 |
+
It's a roleplay model! Trained on ~50k examples of human written roleplay sessions. Not a hint of gpt-flavor writing. Very creative and very able to roll with the punches.
|
376 |
+
|
377 |
+
Does tend to speak for you more than it should and has a very, very strong bias towards speech in quotes.
|
378 |
+
|
379 |
+
Uses ChatML prompt format, with optional length suffixes:
|
380 |
+
|
381 |
+
```
|
382 |
+
<|im_start|>system
|
383 |
+
Enter roleplay mode. You are Steve.
|
384 |
+
|
385 |
+
Steve is a nasty little man and solves all his problems by punching people in the face.<|im_end|>
|
386 |
+
<|im_start|>Gundalf, Gandalf's cousin with a gun
|
387 |
+
Gundalf runs frantically up to Steve and begins yelling. "We have a big problem, Steve!"<|im_end|>
|
388 |
+
<|im_start|>Steve (Length: short)
|
389 |
+
"What is it now Gundalf? Do you want me to punch you in the face?" Steve asked, looking down at him. He was pretty sure that this guy wasn't worth the trouble of punching him in the face, but he didn't like to leave loose ends hanging either.
|
390 |
+
|
391 |
+
"There's been an incident," Gundalf said quickly, "A dwarf has stolen some gold from Smaug."
|
392 |
+
|
393 |
+
"Well I don't care about any of those things," Steve responded, turning away. <|im_end|>
|
394 |
+
```
|
395 |
+
|
396 |
+
[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
|