TheBloke commited on
Commit
8390565
β€’
1 Parent(s): 390d3ab

Initial merged FP16 model commit

Browse files
Files changed (1) hide show
  1. README.md +183 -0
README.md ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ inference: false
3
+ license: other
4
+ ---
5
+
6
+ <!-- header start -->
7
+ <div style="width: 100%;">
8
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
9
+ </div>
10
+ <div style="display: flex; justify-content: space-between; width: 100%;">
11
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
12
+ <p><a href="https://discord.gg/theblokeai">Chat & support: my new Discord server</a></p>
13
+ </div>
14
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
15
+ <p><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
16
+ </div>
17
+ </div>
18
+ <!-- header end -->
19
+
20
+ # WizardLM's WizardLM 13B V1.1 fp16
21
+
22
+ These are fp16 pytorch format model files for [WizardLM's WizardLM 13B V1.1](https://huggingface.co/WizardLM/WizardLM-13B-V1.1) merged with [Kaio Ken's SuperHOT 8K](https://huggingface.co/kaiokendev/superhot-13b-8k-no-rlhf-test).
23
+
24
+ [Kaio Ken's SuperHOT 13b LoRA](https://huggingface.co/kaiokendev/superhot-13b-8k-no-rlhf-test) is merged on to the base model, and then 8K context can be achieved during inference by using `trust_remote_code=True`.
25
+
26
+ Note that `config.json` has been set to a sequence length of 8192. This can be modified to 4096 if you want to try with a smaller sequence length.
27
+
28
+ ## Repositories available
29
+
30
+ * [4-bit GPTQ models for GPU inference](https://huggingface.co/TheBloke/WizardLM-13B-V1-1-SuperHOT-8K-GPTQ)
31
+ * [2, 3, 4, 5, 6 and 8-bit GGML models for CPU inference](https://huggingface.co/TheBloke/WizardLM-13B-V1-1-SuperHOT-8K-GGML)
32
+ * [Unquantised SuperHOT fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/TheBloke/WizardLM-13B-V1-1-SuperHOT-8K-fp16)
33
+ * [Unquantised base fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/WizardLM/WizardLM-13B-V1.1)
34
+
35
+ ## How to use this model from Python code
36
+
37
+ First make sure you have Einops installed:
38
+
39
+ ```
40
+ pip3 install auto-gptq
41
+ ```
42
+
43
+ Then run the following code. `config.json` has been default to a sequence length of 8192, but you can also configure this in your Python code.
44
+
45
+ The provided modelling code, activated with `trust_remote_code=True` will automatically set the `scale` parameter from the configured `max_position_embeddings`. Eg for 8192, `scale` is set to `4`.
46
+
47
+ ```python
48
+ from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM, pipeline
49
+ import argparse
50
+
51
+ model_name_or_path = "TheBloke/WizardLM-13B-V1-1-SuperHOT-8K-fp16"
52
+
53
+ use_triton = False
54
+
55
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
56
+
57
+ config = AutoConfig.from_pretrained(model_name_or_path, trust_remote_code=True)
58
+ # Change this to the sequence length you want
59
+ config.max_position_embeddings = 8192
60
+
61
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
62
+ config=config,
63
+ trust_remote_code=True,
64
+ device_map='auto')
65
+
66
+ # Note: check to confirm if this is correct prompt template is correct for this model!
67
+ prompt = "Tell me about AI"
68
+ prompt_template=f'''USER: {prompt}
69
+ ASSISTANT:'''
70
+
71
+ print("\n\n*** Generate:")
72
+
73
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
74
+ output = model.generate(inputs=input_ids, temperature=0.7, max_new_tokens=512)
75
+ print(tokenizer.decode(output[0]))
76
+
77
+ # Inference can also be done using transformers' pipeline
78
+
79
+ print("*** Pipeline:")
80
+ pipe = pipeline(
81
+ "text-generation",
82
+ model=model,
83
+ tokenizer=tokenizer,
84
+ max_new_tokens=512,
85
+ temperature=0.7,
86
+ top_p=0.95,
87
+ repetition_penalty=1.15
88
+ )
89
+
90
+ print(pipe(prompt_template)[0]['generated_text'])
91
+ ```
92
+
93
+ ## Using other UIs: monkey patch
94
+
95
+ Provided in the repo is `llama_rope_scaled_monkey_patch.py`, written by @kaiokendev.
96
+
97
+ It can be theoretically be added to any Python UI or custom code to enable the same result as `trust_remote_code=True`. I have not tested this, and it should be superseded by using `trust_remote_code=True`, but I include it for completeness and for interest.
98
+
99
+ <!-- footer start -->
100
+ ## Discord
101
+
102
+ For further support, and discussions on these models and AI in general, join us at:
103
+
104
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
105
+
106
+ ## Thanks, and how to contribute.
107
+
108
+ Thanks to the [chirper.ai](https://chirper.ai) team!
109
+
110
+ 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.
111
+
112
+ 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.
113
+
114
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
115
+
116
+ * Patreon: https://patreon.com/TheBlokeAI
117
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
118
+
119
+ **Special thanks to**: Luke from CarbonQuill, Aemon Algiz.
120
+
121
+ **Patreon special mentions**: RoA, Lone Striker, Gabriel Puliatti, Derek Yates, Randy H, Jonathan Leane, Eugene Pentland, Karl Bernard, Viktor Bowallius, senxiiz, Daniel P. Andersen, Pierre Kircher, Deep Realms, Cory Kujawski, Oscar Rangel, Fen Risland, Ajan Kanaga, LangChain4j, webtim, Nikolai Manek, Trenton Dambrowitz, Raven Klaugh, Kalila, Khalefa Al-Ahmad, Chris McCloskey, Luke @flexchar, Ai Maven, Dave, Asp the Wyvern, Sean Connelly, Imad Khwaja, Space Cruiser, Rainer Wilmers, subjectnull, Alps Aficionado, Willian Hasse, Fred von Graf, Artur Olbinski, Johann-Peter Hartmann, WelcomeToTheClub, Willem Michiel, Michael Levine, Iucharbius , Spiking Neurons AB, K, biorpg, John Villwock, Pyrater, Greatston Gnanesh, Mano Prime, Junyu Yang, Stephen Murray, John Detwiler, Luke Pendergrass, terasurfer , Pieter, zynix , Edmond Seymore, theTransient, Nathan LeClaire, vamX, Kevin Schuppel, Preetika Verma, ya boyyy, Alex , SuperWojo, Ghost , Joseph William Delisle, Matthew Berman, Talal Aujan, chris gileta, Illia Dulskyi.
122
+
123
+ Thank you to all my generous patrons and donaters!
124
+
125
+ <!-- footer end -->
126
+
127
+ # Original model card: Kaio Ken's SuperHOT 8K
128
+
129
+
130
+ ### SuperHOT Prototype 2 w/ 8K Context
131
+
132
+ This is a second prototype of SuperHOT, a NSFW focused LoRA, this time 7B with 8K context and no RLHF, using the same technique described in [the github blog](https://kaiokendev.github.io/til#extending-context-to-8k).
133
+
134
+ #### Looking for Merged & Quantized Models?
135
+ Make some please :)
136
+
137
+ #### Using the monkey-patch?
138
+ You will **NEED** to **apply the monkeypatch** or, if you are already using the monkeypatch, **change the scaling factor to 0.25 and the maximum sequence length to 8192**
139
+
140
+ The monkeypatch is only necessary if you are using a front-end/back-end that does not already support scaling and said front-end/back-end is Python-based (i.e. Huggingface Transformers). To apply the patch, you will need to copy the `llama_rope_scaled_monkey_patch.py` into your working directory and call the exported function `replace_llama_rope_with_scaled_rope` at the very start of your Python program. It will modify the Transformers library's implementation of RoPE to properly apply the scaling factor.
141
+
142
+ #### Using Oobabooga with Exllama?
143
+ Switch your loader to `exllama` or `exllama_hf` Add the arguments `max_seq_len 8192` and `compress_pos_emb 4`. **While the model may work well with `compress_pos_emb 2`, it was trained on 4, so that is what I advocate for you to use**
144
+
145
+ Example in the command-line:
146
+ - `python server.py --max_seq_len 8192 --compress_pos_emb 4 --loader exllama_hf`
147
+
148
+ In the UI, you will see the loader option in the `Models` tab. Once you select either `exllama` or `exllama_hf`, the `max_seq_len` and `compress_pos_emb` settings will appear.
149
+
150
+ #### Training Details
151
+ I trained the LoRA with the following configuration:
152
+ - 1200 samples (~400 samples over 2048 sequence length)
153
+ - learning rate of 3e-4
154
+ - 3 epochs
155
+ - The exported modules are:
156
+ - q_proj
157
+ - k_proj
158
+ - v_proj
159
+ - o_proj
160
+ - no bias
161
+ - Rank = 4
162
+ - Alpha = 8
163
+ - no dropout
164
+ - weight decay of 0.1
165
+ - AdamW beta1 of 0.9 and beta2 0.99, epsilon of 1e-5
166
+ - Trained on 4-bit base model
167
+ - Cutoff length: 4096
168
+
169
+ # Original model card: WizardLM's WizardLM 13B V1.1
170
+
171
+
172
+
173
+ This is the **Full-Weight** of WizardLM-13B V1.1 model.
174
+
175
+ **Repository**: https://github.com/nlpxucan/WizardLM
176
+
177
+ **Twitter**: https://twitter.com/WizardLM_AI/status/1677282955490918401
178
+
179
+
180
+ - πŸ”₯πŸ”₯πŸ”₯ [7/7/2023] We released **WizardLM V1.1** models. The **WizardLM-13B-V1.1** is here ([Demo_13B-V1.1](https://e8a06366ccd1c4d1.gradio.app), [Demo_13B-V1.1_bak-1](https://59da107262a25764.gradio.app), [Demo_13B-V1.1_bak-2](https://dfc5113f66739c80.gradio.app), [Full Model Weight](https://huggingface.co/WizardLM/WizardLM-13B-V1.1)). **WizardLM-7B-V1.1**, **WizardLM-30B-V1.1**, and **WizardLM-65B-V1.1** are coming soon. Please checkout the [Full Model Weights](https://huggingface.co/WizardLM) and [paper](https://arxiv.org/abs/2304.12244).
181
+ - πŸ”₯πŸ”₯πŸ”₯ [7/7/2023] The **WizardLM-13B-V1.1** achieves **6.74** on [MT-Bench Leaderboard](https://chat.lmsys.org/?leaderboard), **86.32%** on [AlpacaEval Leaderboard](https://tatsu-lab.github.io/alpaca_eval/), and **99.3%** on [WizardLM Eval](https://github.com/nlpxucan/WizardLM/blob/main/WizardLM/data/WizardLM_testset.jsonl). (Note: MT-Bench and AlpacaEval are all self-test, will push update and request review. All tests are completed under their official settings.)
182
+
183
+