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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: royallab/ZephRP-m7b
|
| 3 |
+
inference: false
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
library_name: transformers
|
| 7 |
+
license: cc-by-nc-4.0
|
| 8 |
+
model_creator: The Royal Lab
|
| 9 |
+
model_name: Zephrp m7b
|
| 10 |
+
model_type: mistral
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
prompt_template: "### Instruction:\nCharacter's Persona: bot character description\n\
|
| 13 |
+
\nUser's persona: user character description\n \nScenario: what happens in the\
|
| 14 |
+
\ story\n\nPlay the role of Character. You must engage in a roleplaying chat with\
|
| 15 |
+
\ User below this line. Do not write dialogues and narration for User. Character\
|
| 16 |
+
\ should respond with messages of medium length.\n\n### Input:\nUser: {prompt}\n\
|
| 17 |
+
\n### Response:\nCharacter: \n"
|
| 18 |
+
quantized_by: TheBloke
|
| 19 |
+
tags:
|
| 20 |
+
- mistral
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
<!-- header start -->
|
| 24 |
+
<!-- 200823 -->
|
| 25 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
| 26 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
| 27 |
+
</div>
|
| 28 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
| 29 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
| 30 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
| 31 |
+
</div>
|
| 32 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
| 33 |
+
<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>
|
| 34 |
+
</div>
|
| 35 |
+
</div>
|
| 36 |
+
<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>
|
| 37 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
| 38 |
+
<!-- header end -->
|
| 39 |
+
|
| 40 |
+
# Zephrp m7b - AWQ
|
| 41 |
+
- Model creator: [The Royal Lab](https://huggingface.co/royallab)
|
| 42 |
+
- Original model: [Zephrp m7b](https://huggingface.co/royallab/ZephRP-m7b)
|
| 43 |
+
|
| 44 |
+
<!-- description start -->
|
| 45 |
+
## Description
|
| 46 |
+
|
| 47 |
+
This repo contains AWQ model files for [The Royal Lab's Zephrp m7b](https://huggingface.co/royallab/ZephRP-m7b).
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
### About AWQ
|
| 51 |
+
|
| 52 |
+
AWQ is an efficient, accurate and blazing-fast low-bit weight quantization method, currently supporting 4-bit quantization. Compared to GPTQ, it offers faster Transformers-based inference.
|
| 53 |
+
|
| 54 |
+
It is also now supported by continuous batching server [vLLM](https://github.com/vllm-project/vllm), allowing use of Llama AWQ models for high-throughput concurrent inference in multi-user server scenarios.
|
| 55 |
+
|
| 56 |
+
As of September 25th 2023, preliminary Llama-only AWQ support has also been added to [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference).
|
| 57 |
+
|
| 58 |
+
Note that, at the time of writing, overall throughput is still lower than running vLLM or TGI with unquantised models, however using AWQ enables using much smaller GPUs which can lead to easier deployment and overall cost savings. For example, a 70B model can be run on 1 x 48GB GPU instead of 2 x 80GB.
|
| 59 |
+
<!-- description end -->
|
| 60 |
+
<!-- repositories-available start -->
|
| 61 |
+
## Repositories available
|
| 62 |
+
|
| 63 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/ZephRP-m7b-AWQ)
|
| 64 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/ZephRP-m7b-GPTQ)
|
| 65 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/ZephRP-m7b-GGUF)
|
| 66 |
+
* [The Royal Lab's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/royallab/ZephRP-m7b)
|
| 67 |
+
<!-- repositories-available end -->
|
| 68 |
+
|
| 69 |
+
<!-- prompt-template start -->
|
| 70 |
+
## Prompt template: LimaRP-Alpaca
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
### Instruction:
|
| 74 |
+
Character's Persona: bot character description
|
| 75 |
+
|
| 76 |
+
User's persona: user character description
|
| 77 |
+
|
| 78 |
+
Scenario: what happens in the story
|
| 79 |
+
|
| 80 |
+
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.
|
| 81 |
+
|
| 82 |
+
### Input:
|
| 83 |
+
User: {prompt}
|
| 84 |
+
|
| 85 |
+
### Response:
|
| 86 |
+
Character:
|
| 87 |
+
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
<!-- prompt-template end -->
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
<!-- README_AWQ.md-provided-files start -->
|
| 94 |
+
## Provided files, and AWQ parameters
|
| 95 |
+
|
| 96 |
+
For my first release of AWQ models, I am releasing 128g models only. I will consider adding 32g as well if there is interest, and once I have done perplexity and evaluation comparisons, but at this time 32g models are still not fully tested with AutoAWQ and vLLM.
|
| 97 |
+
|
| 98 |
+
Models are released as sharded safetensors files.
|
| 99 |
+
|
| 100 |
+
| Branch | Bits | GS | AWQ Dataset | Seq Len | Size |
|
| 101 |
+
| ------ | ---- | -- | ----------- | ------- | ---- |
|
| 102 |
+
| [main](https://huggingface.co/TheBloke/ZephRP-m7b-AWQ/tree/main) | 4 | 128 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.15 GB
|
| 103 |
+
|
| 104 |
+
<!-- README_AWQ.md-provided-files end -->
|
| 105 |
+
|
| 106 |
+
<!-- README_AWQ.md-use-from-vllm start -->
|
| 107 |
+
## Serving this model from vLLM
|
| 108 |
+
|
| 109 |
+
Documentation on installing and using vLLM [can be found here](https://vllm.readthedocs.io/en/latest/).
|
| 110 |
+
|
| 111 |
+
Note: at the time of writing, vLLM has not yet done a new release with AWQ support.
|
| 112 |
+
|
| 113 |
+
If you try the vLLM examples below and get an error about `quantization` being unrecognised, or other AWQ-related issues, please install vLLM from Github source.
|
| 114 |
+
|
| 115 |
+
- When using vLLM as a server, pass the `--quantization awq` parameter, for example:
|
| 116 |
+
|
| 117 |
+
```shell
|
| 118 |
+
python3 python -m vllm.entrypoints.api_server --model TheBloke/ZephRP-m7b-AWQ --quantization awq --dtype half
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
When using vLLM from Python code, pass the `quantization=awq` parameter, for example:
|
| 122 |
+
|
| 123 |
+
```python
|
| 124 |
+
from vllm import LLM, SamplingParams
|
| 125 |
+
|
| 126 |
+
prompts = [
|
| 127 |
+
"Hello, my name is",
|
| 128 |
+
"The president of the United States is",
|
| 129 |
+
"The capital of France is",
|
| 130 |
+
"The future of AI is",
|
| 131 |
+
]
|
| 132 |
+
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
|
| 133 |
+
|
| 134 |
+
llm = LLM(model="TheBloke/ZephRP-m7b-AWQ", quantization="awq", dtype="half")
|
| 135 |
+
|
| 136 |
+
outputs = llm.generate(prompts, sampling_params)
|
| 137 |
+
|
| 138 |
+
# Print the outputs.
|
| 139 |
+
for output in outputs:
|
| 140 |
+
prompt = output.prompt
|
| 141 |
+
generated_text = output.outputs[0].text
|
| 142 |
+
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
|
| 143 |
+
```
|
| 144 |
+
<!-- README_AWQ.md-use-from-vllm start -->
|
| 145 |
+
|
| 146 |
+
<!-- README_AWQ.md-use-from-tgi start -->
|
| 147 |
+
## Serving this model from Text Generation Inference (TGI)
|
| 148 |
+
|
| 149 |
+
Use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
|
| 150 |
+
|
| 151 |
+
Example Docker parameters:
|
| 152 |
+
|
| 153 |
+
```shell
|
| 154 |
+
--model-id TheBloke/ZephRP-m7b-AWQ --port 3000 --quantize awq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
|
| 158 |
+
|
| 159 |
+
```shell
|
| 160 |
+
pip3 install huggingface-hub
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
```python
|
| 164 |
+
from huggingface_hub import InferenceClient
|
| 165 |
+
|
| 166 |
+
endpoint_url = "https://your-endpoint-url-here"
|
| 167 |
+
|
| 168 |
+
prompt = "Tell me about AI"
|
| 169 |
+
prompt_template=f'''### Instruction:
|
| 170 |
+
Character's Persona: bot character description
|
| 171 |
+
|
| 172 |
+
User's persona: user character description
|
| 173 |
+
|
| 174 |
+
Scenario: what happens in the story
|
| 175 |
+
|
| 176 |
+
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.
|
| 177 |
+
|
| 178 |
+
### Input:
|
| 179 |
+
User: {prompt}
|
| 180 |
+
|
| 181 |
+
### Response:
|
| 182 |
+
Character:
|
| 183 |
+
|
| 184 |
+
'''
|
| 185 |
+
|
| 186 |
+
client = InferenceClient(endpoint_url)
|
| 187 |
+
response = client.text_generation(prompt,
|
| 188 |
+
max_new_tokens=128,
|
| 189 |
+
do_sample=True,
|
| 190 |
+
temperature=0.7,
|
| 191 |
+
top_p=0.95,
|
| 192 |
+
top_k=40,
|
| 193 |
+
repetition_penalty=1.1)
|
| 194 |
+
|
| 195 |
+
print(f"Model output: {response}")
|
| 196 |
+
```
|
| 197 |
+
<!-- README_AWQ.md-use-from-tgi end -->
|
| 198 |
+
|
| 199 |
+
<!-- README_AWQ.md-use-from-python start -->
|
| 200 |
+
## How to use this AWQ model from Python code
|
| 201 |
+
|
| 202 |
+
### Install the necessary packages
|
| 203 |
+
|
| 204 |
+
Requires: [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) 0.1.1 or later
|
| 205 |
+
|
| 206 |
+
```shell
|
| 207 |
+
pip3 install autoawq
|
| 208 |
+
```
|
| 209 |
+
|
| 210 |
+
If you have problems installing [AutoAWQ](https://github.com/casper-hansen/AutoAWQ) using the pre-built wheels, install it from source instead:
|
| 211 |
+
|
| 212 |
+
```shell
|
| 213 |
+
pip3 uninstall -y autoawq
|
| 214 |
+
git clone https://github.com/casper-hansen/AutoAWQ
|
| 215 |
+
cd AutoAWQ
|
| 216 |
+
pip3 install .
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
### You can then try the following example code
|
| 220 |
+
|
| 221 |
+
```python
|
| 222 |
+
from awq import AutoAWQForCausalLM
|
| 223 |
+
from transformers import AutoTokenizer
|
| 224 |
+
|
| 225 |
+
model_name_or_path = "TheBloke/ZephRP-m7b-AWQ"
|
| 226 |
+
|
| 227 |
+
# Load model
|
| 228 |
+
model = AutoAWQForCausalLM.from_quantized(model_name_or_path, fuse_layers=True,
|
| 229 |
+
trust_remote_code=False, safetensors=True)
|
| 230 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=False)
|
| 231 |
+
|
| 232 |
+
prompt = "Tell me about AI"
|
| 233 |
+
prompt_template=f'''### Instruction:
|
| 234 |
+
Character's Persona: bot character description
|
| 235 |
+
|
| 236 |
+
User's persona: user character description
|
| 237 |
+
|
| 238 |
+
Scenario: what happens in the story
|
| 239 |
+
|
| 240 |
+
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.
|
| 241 |
+
|
| 242 |
+
### Input:
|
| 243 |
+
User: {prompt}
|
| 244 |
+
|
| 245 |
+
### Response:
|
| 246 |
+
Character:
|
| 247 |
+
|
| 248 |
+
'''
|
| 249 |
+
|
| 250 |
+
print("\n\n*** Generate:")
|
| 251 |
+
|
| 252 |
+
tokens = tokenizer(
|
| 253 |
+
prompt_template,
|
| 254 |
+
return_tensors='pt'
|
| 255 |
+
).input_ids.cuda()
|
| 256 |
+
|
| 257 |
+
# Generate output
|
| 258 |
+
generation_output = model.generate(
|
| 259 |
+
tokens,
|
| 260 |
+
do_sample=True,
|
| 261 |
+
temperature=0.7,
|
| 262 |
+
top_p=0.95,
|
| 263 |
+
top_k=40,
|
| 264 |
+
max_new_tokens=512
|
| 265 |
+
)
|
| 266 |
+
|
| 267 |
+
print("Output: ", tokenizer.decode(generation_output[0]))
|
| 268 |
+
|
| 269 |
+
"""
|
| 270 |
+
# Inference should be possible with transformers pipeline as well in future
|
| 271 |
+
# But currently this is not yet supported by AutoAWQ (correct as of September 25th 2023)
|
| 272 |
+
from transformers import pipeline
|
| 273 |
+
|
| 274 |
+
print("*** Pipeline:")
|
| 275 |
+
pipe = pipeline(
|
| 276 |
+
"text-generation",
|
| 277 |
+
model=model,
|
| 278 |
+
tokenizer=tokenizer,
|
| 279 |
+
max_new_tokens=512,
|
| 280 |
+
do_sample=True,
|
| 281 |
+
temperature=0.7,
|
| 282 |
+
top_p=0.95,
|
| 283 |
+
top_k=40,
|
| 284 |
+
repetition_penalty=1.1
|
| 285 |
+
)
|
| 286 |
+
|
| 287 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
| 288 |
+
"""
|
| 289 |
+
```
|
| 290 |
+
<!-- README_AWQ.md-use-from-python end -->
|
| 291 |
+
|
| 292 |
+
<!-- README_AWQ.md-compatibility start -->
|
| 293 |
+
## Compatibility
|
| 294 |
+
|
| 295 |
+
The files provided are tested to work with:
|
| 296 |
+
|
| 297 |
+
- [AutoAWQ](https://github.com/casper-hansen/AutoAWQ)
|
| 298 |
+
- [vLLM](https://github.com/vllm-project/vllm)
|
| 299 |
+
- [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
| 300 |
+
|
| 301 |
+
TGI merged AWQ support on September 25th, 2023: [TGI PR #1054](https://github.com/huggingface/text-generation-inference/pull/1054). Use the `:latest` Docker container until the next TGI release is made.
|
| 302 |
+
|
| 303 |
+
<!-- README_AWQ.md-compatibility end -->
|
| 304 |
+
|
| 305 |
+
<!-- footer start -->
|
| 306 |
+
<!-- 200823 -->
|
| 307 |
+
## Discord
|
| 308 |
+
|
| 309 |
+
For further support, and discussions on these models and AI in general, join us at:
|
| 310 |
+
|
| 311 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
| 312 |
+
|
| 313 |
+
## Thanks, and how to contribute
|
| 314 |
+
|
| 315 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
| 316 |
+
|
| 317 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
| 318 |
+
|
| 319 |
+
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.
|
| 320 |
+
|
| 321 |
+
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.
|
| 322 |
+
|
| 323 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
| 324 |
+
|
| 325 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
| 326 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
| 327 |
+
|
| 328 |
+
**Special thanks to**: Aemon Algiz.
|
| 329 |
+
|
| 330 |
+
**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
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
Thank you to all my generous patrons and donaters!
|
| 334 |
+
|
| 335 |
+
And thank you again to a16z for their generous grant.
|
| 336 |
+
|
| 337 |
+
<!-- footer end -->
|
| 338 |
+
|
| 339 |
+
# Original model card: The Royal Lab's Zephrp m7b
|
| 340 |
+
|
| 341 |
+
# ZephRP-m7b
|
| 342 |
+
|
| 343 |
+
This is a [Mistral](https://huggingface.co/mistralai/Mistral-7B-v0.1)-based model consisting of a merge between [HuggingFaceH4/zephyr-7b-alpha](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha) and PEFT adapter trained using the LimaRP dataset.
|
| 344 |
+
|
| 345 |
+
The goal was to combine the message length instruction training of LimaRPv3 and additional stylistic elements with the superior knowledge and instruction-following capabilities of the Zephyr model.
|
| 346 |
+
|
| 347 |
+
## Usage:
|
| 348 |
+
The intended prompt format is the Alpaca instruction format of LimaRP v3:
|
| 349 |
+
```
|
| 350 |
+
### Instruction:
|
| 351 |
+
Character's Persona: {bot character description}
|
| 352 |
+
|
| 353 |
+
User's Persona: {user character description}
|
| 354 |
+
|
| 355 |
+
Scenario: {what happens in the story}
|
| 356 |
+
|
| 357 |
+
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.
|
| 358 |
+
|
| 359 |
+
### Input:
|
| 360 |
+
User: {utterance}
|
| 361 |
+
|
| 362 |
+
### Response:
|
| 363 |
+
Character: {utterance}
|
| 364 |
+
|
| 365 |
+
### Input
|
| 366 |
+
User: {utterance}
|
| 367 |
+
|
| 368 |
+
### Response:
|
| 369 |
+
Character: {utterance}
|
| 370 |
+
|
| 371 |
+
(etc.)
|
| 372 |
+
```
|
| 373 |
+
|
| 374 |
+
## Message length control
|
| 375 |
+
Due to the inclusion of LimaRP v3, it is possible to append a length modifier to the response instruction sequence, like this:
|
| 376 |
+
```
|
| 377 |
+
### Input
|
| 378 |
+
User: {utterance}
|
| 379 |
+
|
| 380 |
+
### Response: (length = medium)
|
| 381 |
+
Character: {utterance}
|
| 382 |
+
```
|
| 383 |
+
This has an immediately noticeable effect on bot responses. The available lengths are: `micro, tiny, short, medium, long, massive, huge, enormous, humongous, unlimited`. The recommended starting length is `medium`. Keep in mind that the AI may ramble or impersonate the user with very long messages.
|
| 384 |
+
## Bias, Risks, and Limitations
|
| 385 |
+
The model will show biases similar to those observed in niche roleplaying forums on the Internet, besides those exhibited by the base model. It is not intended for supplying factual information or advice in any form.
|
| 386 |
+
## Training Details
|
| 387 |
+
The LimaRP PEFT adapter was trained as an 8-bit lora using [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl).
|
| 388 |
+
|
| 389 |
+
The following hyperparameters were used during training of the adapter on the original [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) model using a single L40 GPU:
|
| 390 |
+
- learning_rate: 0.00015
|
| 391 |
+
- train_batch_size: 2
|
| 392 |
+
- eval_batch_size: 2
|
| 393 |
+
- seed: 42
|
| 394 |
+
- gradient_accumulation_steps: 4
|
| 395 |
+
- total_train_batch_size: 8
|
| 396 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 397 |
+
- lr_scheduler_type: cosine
|
| 398 |
+
- lr_scheduler_warmup_steps: 10
|
| 399 |
+
- num_epochs: 2
|