tempNameRepost15 commited on
Commit
6ad93f8
1 Parent(s): 8e37207

Upload 12 files

Browse files
LICENSE.txt ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ LLAMA 2 COMMUNITY LICENSE AGREEMENT
2
+ Llama 2 Version Release Date: July 18, 2023
3
+
4
+ "Agreement" means the terms and conditions for use, reproduction, distribution and
5
+ modification of the Llama Materials set forth herein.
6
+
7
+ "Documentation" means the specifications, manuals and documentation
8
+ accompanying Llama 2 distributed by Meta at ai.meta.com/resources/models-and-
9
+ libraries/llama-downloads/.
10
+
11
+ "Licensee" or "you" means you, or your employer or any other person or entity (if
12
+ you are entering into this Agreement on such person or entity's behalf), of the age
13
+ required under applicable laws, rules or regulations to provide legal consent and that
14
+ has legal authority to bind your employer or such other person or entity if you are
15
+ entering in this Agreement on their behalf.
16
+
17
+ "Llama 2" means the foundational large language models and software and
18
+ algorithms, including machine-learning model code, trained model weights,
19
+ inference-enabling code, training-enabling code, fine-tuning enabling code and other
20
+ elements of the foregoing distributed by Meta at ai.meta.com/resources/models-and-
21
+ libraries/llama-downloads/.
22
+
23
+ "Llama Materials" means, collectively, Meta's proprietary Llama 2 and
24
+ Documentation (and any portion thereof) made available under this Agreement.
25
+
26
+ "Meta" or "we" means Meta Platforms Ireland Limited (if you are located in or, if you
27
+ are an entity, your principal place of business is in the EEA or Switzerland) and Meta
28
+ Platforms, Inc. (if you are located outside of the EEA or Switzerland).
29
+
30
+ By clicking "I Accept" below or by using or distributing any portion or element of the
31
+ Llama Materials, you agree to be bound by this Agreement.
32
+
33
+ 1. License Rights and Redistribution.
34
+
35
+ a. Grant of Rights. You are granted a non-exclusive, worldwide, non-
36
+ transferable and royalty-free limited license under Meta's intellectual property or
37
+ other rights owned by Meta embodied in the Llama Materials to use, reproduce,
38
+ distribute, copy, create derivative works of, and make modifications to the Llama
39
+ Materials.
40
+
41
+ b. Redistribution and Use.
42
+
43
+ i. If you distribute or make the Llama Materials, or any derivative works
44
+ thereof, available to a third party, you shall provide a copy of this Agreement to such
45
+ third party.
46
+ ii. If you receive Llama Materials, or any derivative works thereof, from
47
+ a Licensee as part of an integrated end user product, then Section 2 of this
48
+ Agreement will not apply to you.
49
+
50
+ iii. You must retain in all copies of the Llama Materials that you
51
+ distribute the following attribution notice within a "Notice" text file distributed as a
52
+ part of such copies: "Llama 2 is licensed under the LLAMA 2 Community License,
53
+ Copyright (c) Meta Platforms, Inc. All Rights Reserved."
54
+
55
+ iv. Your use of the Llama Materials must comply with applicable laws
56
+ and regulations (including trade compliance laws and regulations) and adhere to the
57
+ Acceptable Use Policy for the Llama Materials (available at
58
+ https://ai.meta.com/llama/use-policy), which is hereby incorporated by reference into
59
+ this Agreement.
60
+
61
+ v. You will not use the Llama Materials or any output or results of the
62
+ Llama Materials to improve any other large language model (excluding Llama 2 or
63
+ derivative works thereof).
64
+
65
+ 2. Additional Commercial Terms. If, on the Llama 2 version release date, the
66
+ monthly active users of the products or services made available by or for Licensee,
67
+ or Licensee's affiliates, is greater than 700 million monthly active users in the
68
+ preceding calendar month, you must request a license from Meta, which Meta may
69
+ grant to you in its sole discretion, and you are not authorized to exercise any of the
70
+ rights under this Agreement unless or until Meta otherwise expressly grants you
71
+ such rights.
72
+
73
+ 3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE
74
+ LLAMA MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE
75
+ PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
76
+ EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY
77
+ WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR
78
+ FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE
79
+ FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING
80
+ THE LLAMA MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR
81
+ USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND RESULTS.
82
+
83
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE
84
+ LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT,
85
+ NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS
86
+ AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL,
87
+ CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN
88
+ IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF
89
+ ANY OF THE FOREGOING.
90
+
91
+ 5. Intellectual Property.
92
+
93
+ a. No trademark licenses are granted under this Agreement, and in
94
+ connection with the Llama Materials, neither Meta nor Licensee may use any name
95
+ or mark owned by or associated with the other or any of its affiliates, except as
96
+ required for reasonable and customary use in describing and redistributing the
97
+ Llama Materials.
98
+
99
+ b. Subject to Meta's ownership of Llama Materials and derivatives made by or
100
+ for Meta, with respect to any derivative works and modifications of the Llama
101
+ Materials that are made by you, as between you and Meta, you are and will be the
102
+ owner of such derivative works and modifications.
103
+
104
+ c. If you institute litigation or other proceedings against Meta or any entity
105
+ (including a cross-claim or counterclaim in a lawsuit) alleging that the Llama
106
+ Materials or Llama 2 outputs or results, or any portion of any of the foregoing,
107
+ constitutes infringement of intellectual property or other rights owned or licensable
108
+ by you, then any licenses granted to you under this Agreement shall terminate as of
109
+ the date such litigation or claim is filed or instituted. You will indemnify and hold
110
+ harmless Meta from and against any claim by any third party arising out of or related
111
+ to your use or distribution of the Llama Materials.
112
+
113
+ 6. Term and Termination. The term of this Agreement will commence upon your
114
+ acceptance of this Agreement or access to the Llama Materials and will continue in
115
+ full force and effect until terminated in accordance with the terms and conditions
116
+ herein. Meta may terminate this Agreement if you are in breach of any term or
117
+ condition of this Agreement. Upon termination of this Agreement, you shall delete
118
+ and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the
119
+ termination of this Agreement.
120
+
121
+ 7. Governing Law and Jurisdiction. This Agreement will be governed and
122
+ construed under the laws of the State of California without regard to choice of law
123
+ principles, and the UN Convention on Contracts for the International Sale of Goods
124
+ does not apply to this Agreement. The courts of California shall have exclusive
125
+ jurisdiction of any dispute arising out of this Agreement.
126
+
Notice.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Llama 2 is licensed under the LLAMA 2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.
README.md ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: llama2
5
+ tags:
6
+ - text generation
7
+ - instruct
8
+ datasets:
9
+ - PygmalionAI/PIPPA
10
+ - Open-Orca/OpenOrca
11
+ - Norquinal/claude_multiround_chat_30k
12
+ - jondurbin/airoboros-gpt4-1.4.1
13
+ - databricks/databricks-dolly-15k
14
+ model_name: Pygmalion 2 7B
15
+ base_model: PygmalionAI/pygmalion-2-7b
16
+ inference: false
17
+ model_creator: PygmalionAI
18
+ model_type: llama
19
+ pipeline_tag: text-generation
20
+ prompt_template: 'The model has been trained on prompts using three different roles,
21
+ which are denoted by the following tokens: `<|system|>`, `<|user|>` and `<|model|>`.
22
+
23
+
24
+ The `<|system|>` prompt can be used to inject out-of-channel information behind
25
+ the scenes, while the `<|user|>` prompt should be used to indicate user input.
26
+
27
+ The `<|model|>` token should then be used to indicate that the model should generate
28
+ a response. These tokens can happen multiple times and be chained up to form a conversation
29
+ history.
30
+
31
+
32
+ The system prompt has been designed to allow the model to "enter" various modes
33
+ and dictate the reply length. Here''s an example:
34
+
35
+
36
+ ```
37
+
38
+ <|system|>Enter RP mode. Pretend to be {{char}} whose persona follows:
39
+
40
+ {{persona}}
41
+
42
+
43
+ You shall reply to the user while staying in character, and generate long responses.
44
+
45
+ ```
46
+
47
+ '
48
+ quantized_by: TheBloke
49
+ ---
50
+
51
+ <!-- header start -->
52
+ <!-- 200823 -->
53
+ <div style="width: auto; margin-left: auto; margin-right: auto">
54
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
55
+ </div>
56
+ <div style="display: flex; justify-content: space-between; width: 100%;">
57
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
58
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
59
+ </div>
60
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
61
+ <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>
62
+ </div>
63
+ </div>
64
+ <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>
65
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
66
+ <!-- header end -->
67
+
68
+ # Pygmalion 2 7B - GPTQ
69
+ - Model creator: [PygmalionAI](https://huggingface.co/PygmalionAI)
70
+ - Original model: [Pygmalion 2 7B](https://huggingface.co/PygmalionAI/pygmalion-2-7b)
71
+
72
+ <!-- description start -->
73
+ ## Description
74
+
75
+ This repo contains GPTQ model files for [PygmalionAI's Pygmalion 2 7B](https://huggingface.co/PygmalionAI/pygmalion-2-7b).
76
+
77
+ 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.
78
+
79
+ <!-- description end -->
80
+ <!-- repositories-available start -->
81
+ ## Repositories available
82
+
83
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Pygmalion-2-7B-AWQ)
84
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Pygmalion-2-7B-GPTQ)
85
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Pygmalion-2-7B-GGUF)
86
+ * [PygmalionAI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/PygmalionAI/pygmalion-2-7b)
87
+ <!-- repositories-available end -->
88
+
89
+ <!-- prompt-template start -->
90
+ ## Prompt template: Custom
91
+
92
+ The model has been trained on prompts using three different roles, which are denoted by the following tokens: `<|system|>`, `<|user|>` and `<|model|>`.
93
+
94
+ The `<|system|>` prompt can be used to inject out-of-channel information behind the scenes, while the `<|user|>` prompt should be used to indicate user input.
95
+ The `<|model|>` token should then be used to indicate that the model should generate a response. These tokens can happen multiple times and be chained up to form a conversation history.
96
+
97
+ The system prompt has been designed to allow the model to "enter" various modes and dictate the reply length. Here's an example:
98
+
99
+ ```
100
+ <|system|>Enter RP mode. Pretend to be {{char}} whose persona follows:
101
+ {{persona}}
102
+
103
+ You shall reply to the user while staying in character, and generate long responses.
104
+ ```
105
+
106
+
107
+ <!-- prompt-template end -->
108
+
109
+
110
+ <!-- README_GPTQ.md-provided-files start -->
111
+ ## Provided files and GPTQ parameters
112
+
113
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
114
+
115
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
116
+
117
+ All recent GPTQ files are made with AutoGPTQ, and all files in non-main branches are made with AutoGPTQ. Files in the `main` branch which were uploaded before August 2023 were made with GPTQ-for-LLaMa.
118
+
119
+ <details>
120
+ <summary>Explanation of GPTQ parameters</summary>
121
+
122
+ - Bits: The bit size of the quantised model.
123
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
124
+ - 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.
125
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
126
+ - GPTQ dataset: The dataset used for quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ 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).
127
+ - 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.
128
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
129
+
130
+ </details>
131
+
132
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
133
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
134
+ | [main](https://huggingface.co/TheBloke/Pygmalion-2-7B-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | 4-bit, without Act Order and group size 128g. |
135
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Pygmalion-2-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.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
136
+ | [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Pygmalion-2-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.02 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
137
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Pygmalion-2-7B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
138
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Pygmalion-2-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.01 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
139
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Pygmalion-2-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.16 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
140
+
141
+ <!-- README_GPTQ.md-provided-files end -->
142
+
143
+ <!-- README_GPTQ.md-download-from-branches start -->
144
+ ## How to download from branches
145
+
146
+ - In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/Pygmalion-2-7B-GPTQ:main`
147
+ - With Git, you can clone a branch with:
148
+ ```
149
+ git clone --single-branch --branch main https://huggingface.co/TheBloke/Pygmalion-2-7B-GPTQ
150
+ ```
151
+ - In Python Transformers code, the branch is the `revision` parameter; see below.
152
+ <!-- README_GPTQ.md-download-from-branches end -->
153
+ <!-- README_GPTQ.md-text-generation-webui start -->
154
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
155
+
156
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
157
+
158
+ 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.
159
+
160
+ 1. Click the **Model tab**.
161
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/Pygmalion-2-7B-GPTQ`.
162
+ - To download from a specific branch, enter for example `TheBloke/Pygmalion-2-7B-GPTQ:main`
163
+ - see Provided Files above for the list of branches for each option.
164
+ 3. Click **Download**.
165
+ 4. The model will start downloading. Once it's finished it will say "Done".
166
+ 5. In the top left, click the refresh icon next to **Model**.
167
+ 6. In the **Model** dropdown, choose the model you just downloaded: `Pygmalion-2-7B-GPTQ`
168
+ 7. The model will automatically load, and is now ready for use!
169
+ 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.
170
+ * 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`.
171
+ 9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
172
+ <!-- README_GPTQ.md-text-generation-webui end -->
173
+
174
+ <!-- README_GPTQ.md-use-from-python start -->
175
+ ## How to use this GPTQ model from Python code
176
+
177
+ ### Install the necessary packages
178
+
179
+ Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
180
+
181
+ ```shell
182
+ pip3 install transformers>=4.32.0 optimum>=1.12.0
183
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
184
+ ```
185
+
186
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
187
+
188
+ ```shell
189
+ pip3 uninstall -y auto-gptq
190
+ git clone https://github.com/PanQiWei/AutoGPTQ
191
+ cd AutoGPTQ
192
+ pip3 install .
193
+ ```
194
+
195
+ ### For CodeLlama models only: you must use Transformers 4.33.0 or later.
196
+
197
+ If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
198
+ ```shell
199
+ pip3 uninstall -y transformers
200
+ pip3 install git+https://github.com/huggingface/transformers.git
201
+ ```
202
+
203
+ ### You can then use the following code
204
+
205
+ ```python
206
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
207
+
208
+ model_name_or_path = "TheBloke/Pygmalion-2-7B-GPTQ"
209
+ # To use a different branch, change revision
210
+ # For example: revision="main"
211
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
212
+ device_map="auto",
213
+ trust_remote_code=False,
214
+ revision="main")
215
+
216
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
217
+
218
+ prompt = "Tell me about AI"
219
+ prompt_template=f'''<|system|>Enter RP mode. Pretend to be {{char}} whose persona follows:
220
+ {{persona}}
221
+
222
+ You shall reply to the user while staying in character, and generate long responses.
223
+
224
+ '''
225
+
226
+ print("\n\n*** Generate:")
227
+
228
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
229
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
230
+ print(tokenizer.decode(output[0]))
231
+
232
+ # Inference can also be done using transformers' pipeline
233
+
234
+ print("*** Pipeline:")
235
+ pipe = pipeline(
236
+ "text-generation",
237
+ model=model,
238
+ tokenizer=tokenizer,
239
+ max_new_tokens=512,
240
+ do_sample=True,
241
+ temperature=0.7,
242
+ top_p=0.95,
243
+ top_k=40,
244
+ repetition_penalty=1.1
245
+ )
246
+
247
+ print(pipe(prompt_template)[0]['generated_text'])
248
+ ```
249
+ <!-- README_GPTQ.md-use-from-python end -->
250
+
251
+ <!-- README_GPTQ.md-compatibility start -->
252
+ ## Compatibility
253
+
254
+ 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).
255
+
256
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
257
+
258
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
259
+ <!-- README_GPTQ.md-compatibility end -->
260
+
261
+ <!-- footer start -->
262
+ <!-- 200823 -->
263
+ ## Discord
264
+
265
+ For further support, and discussions on these models and AI in general, join us at:
266
+
267
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
268
+
269
+ ## Thanks, and how to contribute
270
+
271
+ Thanks to the [chirper.ai](https://chirper.ai) team!
272
+
273
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
274
+
275
+ 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.
276
+
277
+ 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.
278
+
279
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
280
+
281
+ * Patreon: https://patreon.com/TheBlokeAI
282
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
283
+
284
+ **Special thanks to**: Aemon Algiz.
285
+
286
+ **Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
287
+
288
+
289
+ Thank you to all my generous patrons and donaters!
290
+
291
+ And thank you again to a16z for their generous grant.
292
+
293
+ <!-- footer end -->
294
+
295
+ # Original model card: PygmalionAI's Pygmalion 2 7B
296
+
297
+ <h1 style="text-align: center">Pygmalion-2 7B</h1>
298
+ <h2 style="text-align: center">An instruction-tuned Llama-2 biased towards fiction writing and conversation.</h2>
299
+
300
+ ## Model Details
301
+
302
+ The long-awaited release of our new models based on Llama-2 is finally here. Pygmalion-2 7B (formerly known as Metharme) is based on
303
+ [Llama-2 7B](https://huggingface.co/meta-llama/llama-2-7b-hf) released by Meta AI.
304
+
305
+ The Metharme models were an experiment to try and get a model that is usable for conversation, roleplaying and storywriting,
306
+ but which can be guided using natural language like other instruct models. After much deliberation, we reached the conclusion
307
+ that the Metharme prompting format is superior (and easier to use) compared to the classic Pygmalion.
308
+
309
+ This model was trained by doing supervised fine-tuning over a mixture of regular instruction data alongside roleplay, fictional stories
310
+ and conversations with synthetically generated instructions attached.
311
+
312
+ This model is freely available for both commercial and non-commercial use, as per the Llama-2 license.
313
+
314
+
315
+ ## Prompting
316
+
317
+ The model has been trained on prompts using three different roles, which are denoted by the following tokens: `<|system|>`, `<|user|>` and `<|model|>`.
318
+
319
+ The `<|system|>` prompt can be used to inject out-of-channel information behind the scenes, while the `<|user|>` prompt should be used to indicate user input.
320
+ The `<|model|>` token should then be used to indicate that the model should generate a response. These tokens can happen multiple times and be chained up to
321
+ form a conversation history.
322
+
323
+ ### Prompting example
324
+
325
+ The system prompt has been designed to allow the model to "enter" various modes and dictate the reply length. Here's an example:
326
+
327
+ ```
328
+ <|system|>Enter RP mode. Pretend to be {{char}} whose persona follows:
329
+ {{persona}}
330
+
331
+ You shall reply to the user while staying in character, and generate long responses.
332
+ ```
333
+
334
+ ## Dataset
335
+ The dataset used to fine-tune this model includes our own [PIPPA](https://huggingface.co/datasets/PygmalionAI/PIPPA), along with several other instruction
336
+ datasets, and datasets acquired from various RP forums.
337
+
338
+ ## Limitations and biases
339
+
340
+ The intended use-case for this model is fictional writing for entertainment purposes. Any other sort of usage is out of scope.
341
+
342
+ As such, it was **not** fine-tuned to be safe and harmless: the base model _and_ this fine-tune have been trained on data known to contain profanity and texts that
343
+ are lewd or otherwise offensive. It may produce socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive.
344
+ Outputs might often be factually wrong or misleading.
345
+
346
+ ## Acknowledgements
347
+ We would like to thank [SpicyChat](https://spicychat.ai/) for sponsoring the training for this model.
348
+
349
+ [<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)
USE_POLICY.md ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Llama 2 Acceptable Use Policy
2
+
3
+ Meta is committed to promoting safe and fair use of its tools and features, including Llama 2. If you access or use Llama 2, you agree to this Acceptable Use Policy (“Policy”). The most recent copy of this policy can be found at [ai.meta.com/llama/use-policy](http://ai.meta.com/llama/use-policy).
4
+
5
+ ## Prohibited Uses
6
+ We want everyone to use Llama 2 safely and responsibly. You agree you will not use, or allow others to use, Llama 2 to:
7
+
8
+ 1. Violate the law or others’ rights, including to:
9
+ 1. Engage in, promote, generate, contribute to, encourage, plan, incite, or further illegal or unlawful activity or content, such as:
10
+ 1. Violence or terrorism
11
+ 2. Exploitation or harm to children, including the solicitation, creation, acquisition, or dissemination of child exploitative content or failure to report Child Sexual Abuse Material
12
+ 3. Human trafficking, exploitation, and sexual violence
13
+ 4. The illegal distribution of information or materials to minors, including obscene materials, or failure to employ legally required age-gating in connection with such information or materials.
14
+ 5. Sexual solicitation
15
+ 6. Any other criminal activity
16
+ 2. Engage in, promote, incite, or facilitate the harassment, abuse, threatening, or bullying of individuals or groups of individuals
17
+ 3. Engage in, promote, incite, or facilitate discrimination or other unlawful or harmful conduct in the provision of employment, employment benefits, credit, housing, other economic benefits, or other essential goods and services
18
+ 4. Engage in the unauthorized or unlicensed practice of any profession including, but not limited to, financial, legal, medical/health, or related professional practices
19
+ 5. Collect, process, disclose, generate, or infer health, demographic, or other sensitive personal or private information about individuals without rights and consents required by applicable laws
20
+ 6. Engage in or facilitate any action or generate any content that infringes, misappropriates, or otherwise violates any third-party rights, including the outputs or results of any products or services using the Llama 2 Materials
21
+ 7. Create, generate, or facilitate the creation of malicious code, malware, computer viruses or do anything else that could disable, overburden, interfere with or impair the proper working, integrity, operation or appearance of a website or computer system
22
+
23
+
24
+
25
+ 2. Engage in, promote, incite, facilitate, or assist in the planning or development of activities that present a risk of death or bodily harm to individuals, including use of Llama 2 related to the following:
26
+ 1. Military, warfare, nuclear industries or applications, espionage, use for materials or activities that are subject to the International Traffic Arms Regulations (ITAR) maintained by the United States Department of State
27
+ 2. Guns and illegal weapons (including weapon development)
28
+ 3. Illegal drugs and regulated/controlled substances
29
+ 4. Operation of critical infrastructure, transportation technologies, or heavy machinery
30
+ 5. Self-harm or harm to others, including suicide, cutting, and eating disorders
31
+ 6. Any content intended to incite or promote violence, abuse, or any infliction of bodily harm to an individual
32
+
33
+
34
+
35
+ 3. Intentionally deceive or mislead others, including use of Llama 2 related to the following:
36
+ 1. Generating, promoting, or furthering fraud or the creation or promotion of disinformation
37
+ 2. Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content
38
+ 3. Generating, promoting, or further distributing spam
39
+ 4. Impersonating another individual without consent, authorization, or legal right
40
+ 5. Representing that the use of Llama 2 or outputs are human-generated
41
+ 6. Generating or facilitating false online engagement, including fake reviews and other means of fake online engagement
42
+ 4. Fail to appropriately disclose to end users any known dangers of your AI system
43
+
44
+ Please report any violation of this Policy, software “bug,” or other problems that could lead to a violation of this Policy through one of the following means:
45
+
46
+ * Reporting issues with the model: [github.com/facebookresearch/llama](http://github.com/facebookresearch/llama)
47
+ * Reporting risky content generated by the model: [developers.facebook.com/llama_output_feedback](http://developers.facebook.com/llama_output_feedback)
48
+ * Reporting bugs and security concerns: [facebook.com/whitehat/info](http://facebook.com/whitehat/info)
49
+ * Reporting violations of the Acceptable Use Policy or unlicensed uses of Llama: [LlamaUseReport@meta.com](mailto:LlamaUseReport@meta.com)
50
+
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "PygmalionAI/pygmalion-2-7b",
3
+ "architectures": [
4
+ "LlamaForCausalLM"
5
+ ],
6
+ "badwordsids": "[[29961], [14352], [24630], [29962], [11759], [15974], [5519], [25473], [18899], [25901], [7110], [9341], [13531], [518], [9310], [2636], [3366], [21069], [11970], [23098], [16733], [21298], [18173], [10846], [3816], [28513], [15625], [23192], [28166], [10062], [1385], [11724], [3108], [15555], [10834], [10370], [14330], [1822], [12436], [5262], [17094], [10725], [17077], [11424], [4197], [24406], [13359], [17531], [24566], [23076], [4514], [13192], [19942], [16261], [7072], [6024], [1402], [1839], [2033], [13970], [850], [5913], [28895], [5387], [8308], [24927], [5691], [12940], [19997], [18959], [11287], [16862], [4638], [22322], [29861], [21251], [14704], [17548], [12452], [17288], [23160], [24960], [8219], [18024], [5539], [7464], [27865], [29588], [20068], [19660], [27706], [22896], [24264], [12258], [2314], [4400], [5586], [12622], [6796], [7226], [21939], [18456], [14178], [21540], [21945], [14664], [16215], [10338], [17361], [7503], [13769], [26073], [9601], [26909], [7961], [8999], [20840], [16272], [21545], [3199], [10514], [5159], [22689], [6525], [20526], [27077], [18017]]",
7
+ "bos_token_id": 1,
8
+ "eos_token_id": 2,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 4096,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 11008,
13
+ "max_position_embeddings": 4096,
14
+ "model_type": "llama",
15
+ "num_attention_heads": 32,
16
+ "num_hidden_layers": 32,
17
+ "num_key_value_heads": 32,
18
+ "pretraining_tp": 1,
19
+ "rms_norm_eps": 1e-05,
20
+ "rope_scaling": null,
21
+ "tie_word_embeddings": false,
22
+ "torch_dtype": "bfloat16",
23
+ "transformers_version": "4.33.0.dev0",
24
+ "use_cache": true,
25
+ "vocab_size": 32000,
26
+ "pad_token_id": 0,
27
+ "quantization_config": {
28
+ "bits": 4,
29
+ "group_size": 128,
30
+ "damp_percent": 0.1,
31
+ "desc_act": false,
32
+ "sym": true,
33
+ "true_sequential": true,
34
+ "model_name_or_path": null,
35
+ "model_file_base_name": "model",
36
+ "quant_method": "gptq"
37
+ }
38
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 1,
3
+ "do_sample": true,
4
+ "eos_token_id": 2,
5
+ "max_length": 4096,
6
+ "pad_token_id": 0,
7
+ "temperature": 0.6,
8
+ "top_p": 0.9,
9
+ "transformers_version": "4.33.0.dev0"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40c6426fd7751d3183fa4f3f77edfcef7478d783dc6115dcdae26b29b345c089
3
+ size 3896714728
quantize_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bits": 4,
3
+ "group_size": 128,
4
+ "damp_percent": 0.1,
5
+ "desc_act": false,
6
+ "sym": true,
7
+ "true_sequential": true,
8
+ "model_name_or_path": null,
9
+ "model_file_base_name": "model"
10
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "eos_token": "</s>",
4
+ "pad_token": "</s>",
5
+ "unk_token": "<unk>"
6
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "bos_token": {
5
+ "__type": "AddedToken",
6
+ "content": "<s>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "clean_up_tokenization_spaces": false,
13
+ "eos_token": {
14
+ "__type": "AddedToken",
15
+ "content": "</s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "legacy": true,
22
+ "model_max_length": 1000000000000000019884624838656,
23
+ "pad_token": null,
24
+ "padding_side": "right",
25
+ "sp_model_kwargs": {},
26
+ "spaces_between_special_tokens": false,
27
+ "tokenizer_class": "LlamaTokenizer",
28
+ "trust_remote_code": false,
29
+ "unk_token": {
30
+ "__type": "AddedToken",
31
+ "content": "<unk>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "use_default_system_prompt": true,
38
+ "use_fast": true
39
+ }