TheBloke commited on
Commit
8beb785
1 Parent(s): 2eeb91f

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +545 -0
README.md ADDED
@@ -0,0 +1,545 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: lemonilia/AshhLimaRP-Mistral-7B
3
+ inference: false
4
+ license: apache-2.0
5
+ model_creator: Suikamelon
6
+ model_name: AshhLimaRP Mistral 7B
7
+ model_type: mistral
8
+ prompt_template: "### Instruction:\nCharacter's Persona: bot character description\n\
9
+ \nUser's persona: user character description\n \nScenario: what happens in the\
10
+ \ story\n\nPlay the role of Character. You must engage in a roleplaying chat with\
11
+ \ User below this line. Do not write dialogues and narration for User. Character\
12
+ \ should respond with messages of medium length.\n\n### Input:\nUser: {prompt}\n\
13
+ \n### Response:\nCharacter: \n"
14
+ quantized_by: TheBloke
15
+ ---
16
+ <!-- markdownlint-disable MD041 -->
17
+
18
+ <!-- header start -->
19
+ <!-- 200823 -->
20
+ <div style="width: auto; margin-left: auto; margin-right: auto">
21
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
22
+ </div>
23
+ <div style="display: flex; justify-content: space-between; width: 100%;">
24
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
25
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
26
+ </div>
27
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
28
+ <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>
29
+ </div>
30
+ </div>
31
+ <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>
32
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
33
+ <!-- header end -->
34
+
35
+ # AshhLimaRP Mistral 7B - GPTQ
36
+ - Model creator: [Suikamelon](https://huggingface.co/lemonilia)
37
+ - Original model: [AshhLimaRP Mistral 7B](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B)
38
+
39
+ <!-- description start -->
40
+ ## Description
41
+
42
+ This repo contains GPTQ model files for [Suikamelon's AshhLimaRP Mistral 7B](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B).
43
+
44
+ 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.
45
+
46
+ These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
47
+
48
+ <!-- description end -->
49
+ <!-- repositories-available start -->
50
+ ## Repositories available
51
+
52
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-AWQ)
53
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ)
54
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GGUF)
55
+ * [Suikamelon's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B)
56
+ <!-- repositories-available end -->
57
+
58
+ <!-- prompt-template start -->
59
+ ## Prompt template: LimaRP-Alpaca
60
+
61
+ ```
62
+ ### Instruction:
63
+ Character's Persona: bot character description
64
+
65
+ User's persona: user character description
66
+
67
+ Scenario: what happens in the story
68
+
69
+ Play the role of Character. You must engage in a roleplaying chat with User below this line. Do not write dialogues and narration for User. Character should respond with messages of medium length.
70
+
71
+ ### Input:
72
+ User: {prompt}
73
+
74
+ ### Response:
75
+ Character:
76
+
77
+ ```
78
+
79
+ <!-- prompt-template end -->
80
+
81
+
82
+
83
+ <!-- README_GPTQ.md-compatible clients start -->
84
+ ## Known compatible clients / servers
85
+
86
+ These GPTQ models are known to work in the following inference servers/webuis.
87
+
88
+ - [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
89
+ - [KobaldAI United](https://github.com/henk717/koboldai)
90
+ - [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
91
+ - [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
92
+
93
+ This may not be a complete list; if you know of others, please let me know!
94
+ <!-- README_GPTQ.md-compatible clients end -->
95
+
96
+ <!-- README_GPTQ.md-provided-files start -->
97
+ ## Provided files, and GPTQ parameters
98
+
99
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
100
+
101
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
102
+
103
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
104
+
105
+ <details>
106
+ <summary>Explanation of GPTQ parameters</summary>
107
+
108
+ - Bits: The bit size of the quantised model.
109
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
110
+ - 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.
111
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
112
+ - 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).
113
+ - 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.
114
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
115
+
116
+ </details>
117
+
118
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
119
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
120
+ | [main](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ/tree/main) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.16 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
121
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.57 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
122
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.52 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
123
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.68 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
124
+ | [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ/tree/gptq-8bit-32g-actorder_True) | 8 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 8.17 GB | No | 8-bit, with group size 32g and Act Order for maximum inference quality. |
125
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.29 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
126
+
127
+ <!-- README_GPTQ.md-provided-files end -->
128
+
129
+ <!-- README_GPTQ.md-download-from-branches start -->
130
+ ## How to download, including from branches
131
+
132
+ ### In text-generation-webui
133
+
134
+ To download from the `main` branch, enter `TheBloke/AshhLimaRP-Mistral-7B-GPTQ` in the "Download model" box.
135
+
136
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/AshhLimaRP-Mistral-7B-GPTQ:gptq-4bit-32g-actorder_True`
137
+
138
+ ### From the command line
139
+
140
+ I recommend using the `huggingface-hub` Python library:
141
+
142
+ ```shell
143
+ pip3 install huggingface-hub
144
+ ```
145
+
146
+ To download the `main` branch to a folder called `AshhLimaRP-Mistral-7B-GPTQ`:
147
+
148
+ ```shell
149
+ mkdir AshhLimaRP-Mistral-7B-GPTQ
150
+ huggingface-cli download TheBloke/AshhLimaRP-Mistral-7B-GPTQ --local-dir AshhLimaRP-Mistral-7B-GPTQ --local-dir-use-symlinks False
151
+ ```
152
+
153
+ To download from a different branch, add the `--revision` parameter:
154
+
155
+ ```shell
156
+ mkdir AshhLimaRP-Mistral-7B-GPTQ
157
+ huggingface-cli download TheBloke/AshhLimaRP-Mistral-7B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir AshhLimaRP-Mistral-7B-GPTQ --local-dir-use-symlinks False
158
+ ```
159
+
160
+ <details>
161
+ <summary>More advanced huggingface-cli download usage</summary>
162
+
163
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face 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.
164
+
165
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
166
+
167
+ 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).
168
+
169
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
170
+
171
+ ```shell
172
+ pip3 install hf_transfer
173
+ ```
174
+
175
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
176
+
177
+ ```shell
178
+ mkdir AshhLimaRP-Mistral-7B-GPTQ
179
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/AshhLimaRP-Mistral-7B-GPTQ --local-dir AshhLimaRP-Mistral-7B-GPTQ --local-dir-use-symlinks False
180
+ ```
181
+
182
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
183
+ </details>
184
+
185
+ ### With `git` (**not** recommended)
186
+
187
+ To clone a specific branch with `git`, use a command like this:
188
+
189
+ ```shell
190
+ git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/AshhLimaRP-Mistral-7B-GPTQ
191
+ ```
192
+
193
+ 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.)
194
+
195
+ <!-- README_GPTQ.md-download-from-branches end -->
196
+ <!-- README_GPTQ.md-text-generation-webui start -->
197
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
198
+
199
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
200
+
201
+ 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.
202
+
203
+ 1. Click the **Model tab**.
204
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/AshhLimaRP-Mistral-7B-GPTQ`.
205
+
206
+ - To download from a specific branch, enter for example `TheBloke/AshhLimaRP-Mistral-7B-GPTQ:gptq-4bit-32g-actorder_True`
207
+ - see Provided Files above for the list of branches for each option.
208
+
209
+ 3. Click **Download**.
210
+ 4. The model will start downloading. Once it's finished it will say "Done".
211
+ 5. In the top left, click the refresh icon next to **Model**.
212
+ 6. In the **Model** dropdown, choose the model you just downloaded: `AshhLimaRP-Mistral-7B-GPTQ`
213
+ 7. The model will automatically load, and is now ready for use!
214
+ 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.
215
+
216
+ - 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`.
217
+
218
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
219
+
220
+ <!-- README_GPTQ.md-text-generation-webui end -->
221
+
222
+ <!-- README_GPTQ.md-use-from-tgi start -->
223
+ ## Serving this model from Text Generation Inference (TGI)
224
+
225
+ 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`
226
+
227
+ Example Docker parameters:
228
+
229
+ ```shell
230
+ --model-id TheBloke/AshhLimaRP-Mistral-7B-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
231
+ ```
232
+
233
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
234
+
235
+ ```shell
236
+ pip3 install huggingface-hub
237
+ ```
238
+
239
+ ```python
240
+ from huggingface_hub import InferenceClient
241
+
242
+ endpoint_url = "https://your-endpoint-url-here"
243
+
244
+ prompt = "Tell me about AI"
245
+ prompt_template=f'''### Instruction:
246
+ Character's Persona: bot character description
247
+
248
+ User's persona: user character description
249
+
250
+ Scenario: what happens in the story
251
+
252
+ Play the role of Character. You must engage in a roleplaying chat with User below this line. Do not write dialogues and narration for User. Character should respond with messages of medium length.
253
+
254
+ ### Input:
255
+ User: {prompt}
256
+
257
+ ### Response:
258
+ Character:
259
+ '''
260
+
261
+ client = InferenceClient(endpoint_url)
262
+ response = client.text_generation(prompt,
263
+ max_new_tokens=128,
264
+ do_sample=True,
265
+ temperature=0.7,
266
+ top_p=0.95,
267
+ top_k=40,
268
+ repetition_penalty=1.1)
269
+
270
+ print(f"Model output: {response}")
271
+ ```
272
+ <!-- README_GPTQ.md-use-from-tgi end -->
273
+ <!-- README_GPTQ.md-use-from-python start -->
274
+ ## How to use this GPTQ model from Python code
275
+
276
+ ### Install the necessary packages
277
+
278
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
279
+
280
+ ```shell
281
+ pip3 install transformers optimum
282
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
283
+ ```
284
+
285
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
286
+
287
+ ```shell
288
+ pip3 uninstall -y auto-gptq
289
+ git clone https://github.com/PanQiWei/AutoGPTQ
290
+ cd AutoGPTQ
291
+ git checkout v0.4.2
292
+ pip3 install .
293
+ ```
294
+
295
+ ### You can then use the following code
296
+
297
+ ```python
298
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
299
+
300
+ model_name_or_path = "TheBloke/AshhLimaRP-Mistral-7B-GPTQ"
301
+ # To use a different branch, change revision
302
+ # For example: revision="gptq-4bit-32g-actorder_True"
303
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
304
+ device_map="auto",
305
+ trust_remote_code=False,
306
+ revision="main")
307
+
308
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
309
+
310
+ prompt = "Tell me about AI"
311
+ prompt_template=f'''### Instruction:
312
+ Character's Persona: bot character description
313
+
314
+ User's persona: user character description
315
+
316
+ Scenario: what happens in the story
317
+
318
+ Play the role of Character. You must engage in a roleplaying chat with User below this line. Do not write dialogues and narration for User. Character should respond with messages of medium length.
319
+
320
+ ### Input:
321
+ User: {prompt}
322
+
323
+ ### Response:
324
+ Character:
325
+ '''
326
+
327
+ print("\n\n*** Generate:")
328
+
329
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
330
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
331
+ print(tokenizer.decode(output[0]))
332
+
333
+ # Inference can also be done using transformers' pipeline
334
+
335
+ print("*** Pipeline:")
336
+ pipe = pipeline(
337
+ "text-generation",
338
+ model=model,
339
+ tokenizer=tokenizer,
340
+ max_new_tokens=512,
341
+ do_sample=True,
342
+ temperature=0.7,
343
+ top_p=0.95,
344
+ top_k=40,
345
+ repetition_penalty=1.1
346
+ )
347
+
348
+ print(pipe(prompt_template)[0]['generated_text'])
349
+ ```
350
+ <!-- README_GPTQ.md-use-from-python end -->
351
+
352
+ <!-- README_GPTQ.md-compatibility start -->
353
+ ## Compatibility
354
+
355
+ The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
356
+
357
+ [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.
358
+
359
+ For a list of clients/servers, please see "Known compatible clients / servers", above.
360
+ <!-- README_GPTQ.md-compatibility end -->
361
+
362
+ <!-- footer start -->
363
+ <!-- 200823 -->
364
+ ## Discord
365
+
366
+ For further support, and discussions on these models and AI in general, join us at:
367
+
368
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
369
+
370
+ ## Thanks, and how to contribute
371
+
372
+ Thanks to the [chirper.ai](https://chirper.ai) team!
373
+
374
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
375
+
376
+ 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.
377
+
378
+ 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.
379
+
380
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
381
+
382
+ * Patreon: https://patreon.com/TheBlokeAI
383
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
384
+
385
+ **Special thanks to**: Aemon Algiz.
386
+
387
+ **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
388
+
389
+
390
+ Thank you to all my generous patrons and donaters!
391
+
392
+ And thank you again to a16z for their generous grant.
393
+
394
+ <!-- footer end -->
395
+
396
+ # Original model card: Suikamelon's AshhLimaRP Mistral 7B
397
+
398
+
399
+ # AshhLimaRP-Mistral-7B (Alpaca, v1)
400
+
401
+ This is a version of LimaRP with 2000 training samples _up to_ about 9k tokens length
402
+ finetuned on [Ashhwriter-Mistral-7B](https://huggingface.co/lemonilia/Ashhwriter-Mistral-7B).
403
+
404
+ LimaRP is a longform-oriented, novel-style roleplaying chat model intended to replicate the experience
405
+ of 1-on-1 roleplay on Internet forums. Short-form, IRC/Discord-style RP (aka "Markdown format")
406
+ is not supported. The model does not include instruction tuning, only manually picked and
407
+ slightly edited RP conversations with persona and scenario data.
408
+
409
+ Ashhwriter, the base, is a model entirely finetuned on human-written lewd stories.
410
+
411
+ ## Available versions
412
+ - Float16 HF weights
413
+ - LoRA Adapter ([adapter_config.json](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B/resolve/main/adapter_config.json) and [adapter_model.bin](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B/resolve/main/adapter_model.bin))
414
+ - [4bit AWQ](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B/tree/main/AWQ)
415
+ - [Q4_K_M GGUF](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B/resolve/main/AshhLimaRP-Mistral-7B.Q4_K_M.gguf)
416
+ - [Q6_K GGUF](https://huggingface.co/lemonilia/AshhLimaRP-Mistral-7B/resolve/main/AshhLimaRP-Mistral-7B.Q6_K.gguf)
417
+
418
+ ## Prompt format
419
+ [Extended Alpaca format](https://github.com/tatsu-lab/stanford_alpaca),
420
+ with `### Instruction:`, `### Input:` immediately preceding user inputs and `### Response:`
421
+ immediately preceding model outputs. While Alpaca wasn't originally intended for multi-turn
422
+ responses, in practice this is not a problem; the format follows a pattern already used by
423
+ other models.
424
+
425
+ ```
426
+ ### Instruction:
427
+ Character's Persona: {bot character description}
428
+
429
+ User's Persona: {user character description}
430
+
431
+ Scenario: {what happens in the story}
432
+
433
+ Play the role of Character. You must engage in a roleplaying chat with User below this line. Do not write dialogues and narration for User.
434
+
435
+ ### Input:
436
+ User: {utterance}
437
+
438
+ ### Response:
439
+ Character: {utterance}
440
+
441
+ ### Input
442
+ User: {utterance}
443
+
444
+ ### Response:
445
+ Character: {utterance}
446
+
447
+ (etc.)
448
+ ```
449
+
450
+ You should:
451
+ - Replace all text in curly braces (curly braces included) with your own text.
452
+ - Replace `User` and `Character` with appropriate names.
453
+
454
+
455
+ ### Message length control
456
+ Inspired by the previously named "Roleplay" preset in SillyTavern, with this
457
+ version of LimaRP it is possible to append a length modifier to the response instruction
458
+ sequence, like this:
459
+
460
+ ```
461
+ ### Input
462
+ User: {utterance}
463
+
464
+ ### Response: (length = medium)
465
+ Character: {utterance}
466
+ ```
467
+
468
+ This has an immediately noticeable effect on bot responses. The lengths using during training are:
469
+ `micro`, `tiny`, `short`, `medium`, `long`, `massive`, `huge`, `enormous`, `humongous`, `unlimited`.
470
+ **The recommended starting length is medium**. Keep in mind that the AI can ramble or impersonate
471
+ the user with very long messages.
472
+
473
+ The length control effect is reproducible, but the messages will not necessarily follow
474
+ lengths very precisely, rather follow certain ranges on average, as seen in this table
475
+ with data from tests made with one reply at the beginning of the conversation:
476
+
477
+ ![lengths](https://i.imgur.com/2WXGgaV.png)
478
+
479
+ Response length control appears to work well also deep into the conversation. **By omitting
480
+ the modifier, the model will choose the most appropriate response length** (although it might
481
+ not necessarily be what the user desires).
482
+
483
+ ## Suggested settings
484
+ You can follow these instruction format settings in SillyTavern. Replace `medium` with
485
+ your desired response length:
486
+
487
+ ![settings](https://files.catbox.moe/fpieug.png)
488
+
489
+ ## Text generation settings
490
+ These settings could be a good general starting point:
491
+
492
+ - TFS = 0.90
493
+ - Temperature = 0.70
494
+ - Repetition penalty = ~1.11
495
+ - Repetition penalty range = ~2048
496
+ - top-k = 0 (disabled)
497
+ - top-p = 1 (disabled)
498
+
499
+ ## Training procedure
500
+ [Axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) was used for training
501
+ on 2x NVidia A40 GPUs.
502
+
503
+ The A40 GPUs have been graciously provided by [Arc Compute](https://www.arccompute.io/).
504
+
505
+ ### Training hyperparameters
506
+ A lower learning rate than usual was employed. Due to an unforeseen issue the training
507
+ was cut short and as a result 3 epochs were trained instead of the planned 4. Using 2 GPUs,
508
+ the effective global batch size would have been 16.
509
+
510
+ Training was continued from the most recent LoRA adapter from Ashhwriter, using the same
511
+ LoRA R and LoRA alpha.
512
+
513
+ - lora_model_dir: /home/anon/bin/axolotl/OUT_mistral-stories/checkpoint-6000/
514
+ - learning_rate: 0.00005
515
+ - lr_scheduler: cosine
516
+ - noisy_embedding_alpha: 3.5
517
+ - num_epochs: 4
518
+ - sequence_len: 8750
519
+ - lora_r: 256
520
+ - lora_alpha: 16
521
+ - lora_dropout: 0.05
522
+ - lora_target_linear: True
523
+ - bf16: True
524
+ - fp16: false
525
+ - tf32: True
526
+ - load_in_8bit: True
527
+ - adapter: lora
528
+ - micro_batch_size: 2
529
+ - optimizer: adamw_bnb_8bit
530
+ - warmup_steps: 10
531
+ - optimizer: adamw_torch
532
+ - flash_attention: true
533
+ - sample_packing: true
534
+ - pad_to_sequence_len: true
535
+
536
+
537
+ ### Loss graphs
538
+ Values are higher than typical because the training is performed on the entire
539
+ sample, similar to unsupervised finetuning.
540
+
541
+ #### Train loss
542
+ ![Train loss](https://files.catbox.moe/ovw8c7.png)
543
+
544
+ #### Eval loss
545
+ ![Eval loss](https://files.catbox.moe/yp7o0h.png)