Upload README.md
Browse files
README.md
ADDED
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: Norquinal/Mistral-7B-claude-chat
|
3 |
+
datasets:
|
4 |
+
- Norquinal/claude_multiround_chat_1k
|
5 |
+
inference: false
|
6 |
+
license: cc-by-nc-4.0
|
7 |
+
model_creator: Andy B. Norquinal
|
8 |
+
model_name: Mistral 7B Claude Chat
|
9 |
+
model_type: mistral
|
10 |
+
prompt_template: 'A chat between a curious user and an artificial intelligence assistant.
|
11 |
+
The assistant gives helpful, detailed, and polite answers to the user''s questions.
|
12 |
+
USER: {prompt} ASSISTANT:
|
13 |
+
|
14 |
+
'
|
15 |
+
quantized_by: TheBloke
|
16 |
+
---
|
17 |
+
<!-- markdownlint-disable MD041 -->
|
18 |
+
|
19 |
+
<!-- header start -->
|
20 |
+
<!-- 200823 -->
|
21 |
+
<div style="width: auto; margin-left: auto; margin-right: auto">
|
22 |
+
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
23 |
+
</div>
|
24 |
+
<div style="display: flex; justify-content: space-between; width: 100%;">
|
25 |
+
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
26 |
+
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
27 |
+
</div>
|
28 |
+
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
29 |
+
<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>
|
30 |
+
</div>
|
31 |
+
</div>
|
32 |
+
<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>
|
33 |
+
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
34 |
+
<!-- header end -->
|
35 |
+
|
36 |
+
# Mistral 7B Claude Chat - GPTQ
|
37 |
+
- Model creator: [Andy B. Norquinal](https://huggingface.co/Norquinal)
|
38 |
+
- Original model: [Mistral 7B Claude Chat](https://huggingface.co/Norquinal/Mistral-7B-claude-chat)
|
39 |
+
|
40 |
+
<!-- description start -->
|
41 |
+
## Description
|
42 |
+
|
43 |
+
This repo contains GPTQ model files for [Andy B. Norquinal's Mistral 7B Claude Chat](https://huggingface.co/Norquinal/Mistral-7B-claude-chat).
|
44 |
+
|
45 |
+
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.
|
46 |
+
|
47 |
+
These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
|
48 |
+
|
49 |
+
<!-- description end -->
|
50 |
+
<!-- repositories-available start -->
|
51 |
+
## Repositories available
|
52 |
+
|
53 |
+
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-AWQ)
|
54 |
+
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-GPTQ)
|
55 |
+
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-GGUF)
|
56 |
+
* [Andy B. Norquinal's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/Norquinal/Mistral-7B-claude-chat)
|
57 |
+
<!-- repositories-available end -->
|
58 |
+
|
59 |
+
<!-- prompt-template start -->
|
60 |
+
## Prompt template: Vicuna
|
61 |
+
|
62 |
+
```
|
63 |
+
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
|
64 |
+
|
65 |
+
```
|
66 |
+
|
67 |
+
<!-- prompt-template end -->
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
<!-- README_GPTQ.md-compatible clients start -->
|
72 |
+
## Known compatible clients / servers
|
73 |
+
|
74 |
+
These GPTQ models are known to work in the following inference servers/webuis.
|
75 |
+
|
76 |
+
- [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
77 |
+
- [KobaldAI United](https://github.com/henk717/koboldai)
|
78 |
+
- [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
|
79 |
+
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
|
80 |
+
|
81 |
+
This may not be a complete list; if you know of others, please let me know!
|
82 |
+
<!-- README_GPTQ.md-compatible clients end -->
|
83 |
+
|
84 |
+
<!-- README_GPTQ.md-provided-files start -->
|
85 |
+
## Provided files, and GPTQ parameters
|
86 |
+
|
87 |
+
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
88 |
+
|
89 |
+
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
90 |
+
|
91 |
+
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
|
92 |
+
|
93 |
+
<details>
|
94 |
+
<summary>Explanation of GPTQ parameters</summary>
|
95 |
+
|
96 |
+
- Bits: The bit size of the quantised model.
|
97 |
+
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
98 |
+
- 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.
|
99 |
+
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
100 |
+
- 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).
|
101 |
+
- 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.
|
102 |
+
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
|
103 |
+
|
104 |
+
</details>
|
105 |
+
|
106 |
+
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
107 |
+
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
108 |
+
| [main](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-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. |
|
109 |
+
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-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. |
|
110 |
+
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-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. |
|
111 |
+
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-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. |
|
112 |
+
| [gptq-8bit-32g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-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. |
|
113 |
+
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-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. |
|
114 |
+
|
115 |
+
<!-- README_GPTQ.md-provided-files end -->
|
116 |
+
|
117 |
+
<!-- README_GPTQ.md-download-from-branches start -->
|
118 |
+
## How to download, including from branches
|
119 |
+
|
120 |
+
### In text-generation-webui
|
121 |
+
|
122 |
+
To download from the `main` branch, enter `TheBloke/Mistral-7B-Claude-Chat-GPTQ` in the "Download model" box.
|
123 |
+
|
124 |
+
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Mistral-7B-Claude-Chat-GPTQ:gptq-4bit-32g-actorder_True`
|
125 |
+
|
126 |
+
### From the command line
|
127 |
+
|
128 |
+
I recommend using the `huggingface-hub` Python library:
|
129 |
+
|
130 |
+
```shell
|
131 |
+
pip3 install huggingface-hub
|
132 |
+
```
|
133 |
+
|
134 |
+
To download the `main` branch to a folder called `Mistral-7B-Claude-Chat-GPTQ`:
|
135 |
+
|
136 |
+
```shell
|
137 |
+
mkdir Mistral-7B-Claude-Chat-GPTQ
|
138 |
+
huggingface-cli download TheBloke/Mistral-7B-Claude-Chat-GPTQ --local-dir Mistral-7B-Claude-Chat-GPTQ --local-dir-use-symlinks False
|
139 |
+
```
|
140 |
+
|
141 |
+
To download from a different branch, add the `--revision` parameter:
|
142 |
+
|
143 |
+
```shell
|
144 |
+
mkdir Mistral-7B-Claude-Chat-GPTQ
|
145 |
+
huggingface-cli download TheBloke/Mistral-7B-Claude-Chat-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir Mistral-7B-Claude-Chat-GPTQ --local-dir-use-symlinks False
|
146 |
+
```
|
147 |
+
|
148 |
+
<details>
|
149 |
+
<summary>More advanced huggingface-cli download usage</summary>
|
150 |
+
|
151 |
+
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.
|
152 |
+
|
153 |
+
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
|
154 |
+
|
155 |
+
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).
|
156 |
+
|
157 |
+
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
|
158 |
+
|
159 |
+
```shell
|
160 |
+
pip3 install hf_transfer
|
161 |
+
```
|
162 |
+
|
163 |
+
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
|
164 |
+
|
165 |
+
```shell
|
166 |
+
mkdir Mistral-7B-Claude-Chat-GPTQ
|
167 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Mistral-7B-Claude-Chat-GPTQ --local-dir Mistral-7B-Claude-Chat-GPTQ --local-dir-use-symlinks False
|
168 |
+
```
|
169 |
+
|
170 |
+
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
|
171 |
+
</details>
|
172 |
+
|
173 |
+
### With `git` (**not** recommended)
|
174 |
+
|
175 |
+
To clone a specific branch with `git`, use a command like this:
|
176 |
+
|
177 |
+
```shell
|
178 |
+
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Mistral-7B-Claude-Chat-GPTQ
|
179 |
+
```
|
180 |
+
|
181 |
+
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.)
|
182 |
+
|
183 |
+
<!-- README_GPTQ.md-download-from-branches end -->
|
184 |
+
<!-- README_GPTQ.md-text-generation-webui start -->
|
185 |
+
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
|
186 |
+
|
187 |
+
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
188 |
+
|
189 |
+
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.
|
190 |
+
|
191 |
+
1. Click the **Model tab**.
|
192 |
+
2. Under **Download custom model or LoRA**, enter `TheBloke/Mistral-7B-Claude-Chat-GPTQ`.
|
193 |
+
|
194 |
+
- To download from a specific branch, enter for example `TheBloke/Mistral-7B-Claude-Chat-GPTQ:gptq-4bit-32g-actorder_True`
|
195 |
+
- see Provided Files above for the list of branches for each option.
|
196 |
+
|
197 |
+
3. Click **Download**.
|
198 |
+
4. The model will start downloading. Once it's finished it will say "Done".
|
199 |
+
5. In the top left, click the refresh icon next to **Model**.
|
200 |
+
6. In the **Model** dropdown, choose the model you just downloaded: `Mistral-7B-Claude-Chat-GPTQ`
|
201 |
+
7. The model will automatically load, and is now ready for use!
|
202 |
+
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.
|
203 |
+
|
204 |
+
- 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`.
|
205 |
+
|
206 |
+
9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
|
207 |
+
|
208 |
+
<!-- README_GPTQ.md-text-generation-webui end -->
|
209 |
+
|
210 |
+
<!-- README_GPTQ.md-use-from-tgi start -->
|
211 |
+
## Serving this model from Text Generation Inference (TGI)
|
212 |
+
|
213 |
+
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`
|
214 |
+
|
215 |
+
Example Docker parameters:
|
216 |
+
|
217 |
+
```shell
|
218 |
+
--model-id TheBloke/Mistral-7B-Claude-Chat-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
|
219 |
+
```
|
220 |
+
|
221 |
+
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
|
222 |
+
|
223 |
+
```shell
|
224 |
+
pip3 install huggingface-hub
|
225 |
+
```
|
226 |
+
|
227 |
+
```python
|
228 |
+
from huggingface_hub import InferenceClient
|
229 |
+
|
230 |
+
endpoint_url = "https://your-endpoint-url-here"
|
231 |
+
|
232 |
+
prompt = "Tell me about AI"
|
233 |
+
prompt_template=f'''A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
|
234 |
+
'''
|
235 |
+
|
236 |
+
client = InferenceClient(endpoint_url)
|
237 |
+
response = client.text_generation(prompt,
|
238 |
+
max_new_tokens=128,
|
239 |
+
do_sample=True,
|
240 |
+
temperature=0.7,
|
241 |
+
top_p=0.95,
|
242 |
+
top_k=40,
|
243 |
+
repetition_penalty=1.1)
|
244 |
+
|
245 |
+
print(f"Model output: {response}")
|
246 |
+
```
|
247 |
+
<!-- README_GPTQ.md-use-from-tgi end -->
|
248 |
+
<!-- README_GPTQ.md-use-from-python start -->
|
249 |
+
## How to use this GPTQ model from Python code
|
250 |
+
|
251 |
+
### Install the necessary packages
|
252 |
+
|
253 |
+
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
254 |
+
|
255 |
+
```shell
|
256 |
+
pip3 install transformers optimum
|
257 |
+
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
258 |
+
```
|
259 |
+
|
260 |
+
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
261 |
+
|
262 |
+
```shell
|
263 |
+
pip3 uninstall -y auto-gptq
|
264 |
+
git clone https://github.com/PanQiWei/AutoGPTQ
|
265 |
+
cd AutoGPTQ
|
266 |
+
git checkout v0.4.2
|
267 |
+
pip3 install .
|
268 |
+
```
|
269 |
+
|
270 |
+
### You can then use the following code
|
271 |
+
|
272 |
+
```python
|
273 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
274 |
+
|
275 |
+
model_name_or_path = "TheBloke/Mistral-7B-Claude-Chat-GPTQ"
|
276 |
+
# To use a different branch, change revision
|
277 |
+
# For example: revision="gptq-4bit-32g-actorder_True"
|
278 |
+
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
279 |
+
device_map="auto",
|
280 |
+
trust_remote_code=False,
|
281 |
+
revision="main")
|
282 |
+
|
283 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
284 |
+
|
285 |
+
prompt = "Tell me about AI"
|
286 |
+
prompt_template=f'''A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {prompt} ASSISTANT:
|
287 |
+
'''
|
288 |
+
|
289 |
+
print("\n\n*** Generate:")
|
290 |
+
|
291 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
292 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
293 |
+
print(tokenizer.decode(output[0]))
|
294 |
+
|
295 |
+
# Inference can also be done using transformers' pipeline
|
296 |
+
|
297 |
+
print("*** Pipeline:")
|
298 |
+
pipe = pipeline(
|
299 |
+
"text-generation",
|
300 |
+
model=model,
|
301 |
+
tokenizer=tokenizer,
|
302 |
+
max_new_tokens=512,
|
303 |
+
do_sample=True,
|
304 |
+
temperature=0.7,
|
305 |
+
top_p=0.95,
|
306 |
+
top_k=40,
|
307 |
+
repetition_penalty=1.1
|
308 |
+
)
|
309 |
+
|
310 |
+
print(pipe(prompt_template)[0]['generated_text'])
|
311 |
+
```
|
312 |
+
<!-- README_GPTQ.md-use-from-python end -->
|
313 |
+
|
314 |
+
<!-- README_GPTQ.md-compatibility start -->
|
315 |
+
## Compatibility
|
316 |
+
|
317 |
+
The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
|
318 |
+
|
319 |
+
[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.
|
320 |
+
|
321 |
+
For a list of clients/servers, please see "Known compatible clients / servers", above.
|
322 |
+
<!-- README_GPTQ.md-compatibility end -->
|
323 |
+
|
324 |
+
<!-- footer start -->
|
325 |
+
<!-- 200823 -->
|
326 |
+
## Discord
|
327 |
+
|
328 |
+
For further support, and discussions on these models and AI in general, join us at:
|
329 |
+
|
330 |
+
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
331 |
+
|
332 |
+
## Thanks, and how to contribute
|
333 |
+
|
334 |
+
Thanks to the [chirper.ai](https://chirper.ai) team!
|
335 |
+
|
336 |
+
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
337 |
+
|
338 |
+
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.
|
339 |
+
|
340 |
+
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.
|
341 |
+
|
342 |
+
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
343 |
+
|
344 |
+
* Patreon: https://patreon.com/TheBlokeAI
|
345 |
+
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
346 |
+
|
347 |
+
**Special thanks to**: Aemon Algiz.
|
348 |
+
|
349 |
+
**Patreon special mentions**: Brandon Frisco, LangChain4j, Spiking Neurons AB, transmissions 11, Joseph William Delisle, Nitin Borwankar, Willem Michiel, Michael Dempsey, vamX, Jeffrey Morgan, zynix, jjj, Omer Bin Jawed, Sean Connelly, jinyuan sun, Jeromy Smith, Shadi, Pawan Osman, Chadd, Elijah Stavena, Illia Dulskyi, Sebastain Graf, Stephen Murray, terasurfer, Edmond Seymore, Celu Ramasamy, Mandus, Alex, biorpg, Ajan Kanaga, Clay Pascal, Raven Klaugh, 阿明, K, ya boyyy, usrbinkat, Alicia Loh, John Villwock, ReadyPlayerEmma, Chris Smitley, Cap'n Zoog, fincy, GodLy, S_X, sidney chen, Cory Kujawski, OG, Mano Prime, AzureBlack, Pieter, Kalila, Spencer Kim, Tom X Nguyen, Stanislav Ovsiannikov, Michael Levine, Andrey, Trailburnt, Vadim, Enrico Ros, Talal Aujan, Brandon Phillips, Jack West, Eugene Pentland, Michael Davis, Will Dee, webtim, Jonathan Leane, Alps Aficionado, Rooh Singh, Tiffany J. Kim, theTransient, Luke @flexchar, Elle, Caitlyn Gatomon, Ari Malik, subjectnull, Johann-Peter Hartmann, Trenton Dambrowitz, Imad Khwaja, Asp the Wyvern, Emad Mostaque, Rainer Wilmers, Alexandros Triantafyllidis, Nicholas, Pedro Madruga, SuperWojo, Harry Royden McLaughlin, James Bentley, Olakabola, David Ziegler, Ai Maven, Jeff Scroggin, Nikolai Manek, Deo Leter, Matthew Berman, Fen Risland, Ken Nordquist, Manuel Alberto Morcote, Luke Pendergrass, TL, Fred von Graf, Randy H, Dan Guido, NimbleBox.ai, Vitor Caleffi, Gabriel Tamborski, knownsqashed, Lone Striker, Erik Bjäreholt, John Detwiler, Leonard Tan, Iucharbius
|
350 |
+
|
351 |
+
|
352 |
+
Thank you to all my generous patrons and donaters!
|
353 |
+
|
354 |
+
And thank you again to a16z for their generous grant.
|
355 |
+
|
356 |
+
<!-- footer end -->
|
357 |
+
|
358 |
+
# Original model card: Andy B. Norquinal's Mistral 7B Claude Chat
|
359 |
+
|
360 |
+
This is the [Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) model fine-tuned using QLoRA (4-bit precision) on my [claude_multiround_chat_1k](https://huggingface.co/datasets/Norquinal/claude_multiround_chat_1k) dataset, which is a randomized subset of ~1000 samples from my [claude_multiround_chat_30k](https://huggingface.co/datasets/Norquinal/claude_multiround_chat_30k) dataset.
|
361 |
+
|
362 |
+
## Prompt Format
|
363 |
+
The model was finetuned with the Vicuna 1.1 prompt format:
|
364 |
+
```
|
365 |
+
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
|
366 |
+
|
367 |
+
USER: {instruction}
|
368 |
+
ASSISTANT:
|
369 |
+
```
|
370 |
+
|
371 |
+
## Use in Text Generation Web UI
|
372 |
+
Install the bleeding-edge version of `transformers` from source:
|
373 |
+
```
|
374 |
+
pip install git+https://github.com/huggingface/transformers
|
375 |
+
```
|
376 |
+
Or, alternatively, change `model_type` in `config.json` from `mistral` to `llama`.
|
377 |
+
|
378 |
+
## Example Usage
|
379 |
+
>USER: First, give a brief overview of Chinese cuisine, including its regional diversity. next, describe the importance of the five flavors in Chinese cooking. Then, mention three popular Chinese dishes and their main ingredients. After that, provide a popular Chinese cooking technique and an example of a dish prepared using that technique. Finally, discuss the role of tea in traditional Chinese culture.
|
380 |
+
|
381 |
+
>ASSISTANT: Chinese cuisine is incredibly diverse due to its large geographic area with different climates and resources available. Regional specialties include Sichuan spicy hot pot, Cantonese dim sum and seafood dishes, Beijing roast duck, and Hunan stir-fries.
|
382 |
+
>
|
383 |
+
>The five basic tastes that guide Chinese cookery are sweetness, sourness, bitterness, saltiness, and pungency (spiciness). These contrasting flavors are used together to create balance in each dish.
|
384 |
+
>
|
385 |
+
>Some classic Chinese dishes include dumplings filled with meat or vegetables, spring rolls stuffed with vegetables and meat wrapped in thin pastry, and noodles served in soups or stir fried with sauces and vegetables.
|
386 |
+
>
|
387 |
+
>A common Chinese cooking technique is braising, where food is slowly cooked in a small amount of liquid until tender and flavorful. An example would be beef brisket braised in soy sauce, ginger and star anise for hours until falling apart.
|
388 |
+
>
|
389 |
+
>Tea plays a central role in Chinese culture as it represents hospitality, relaxation and socializing. Green teas are most commonly consumed but black, oolong and white varieties also exist. Tea drinking rituals involve preparing and serving tea in specific ways depending on context and occasion.
|
390 |
+
>
|
391 |
+
>In summary, Chinese cuisine offers a rich culinary tradition influenced by regional differences, an emphasis on balancing the five basic flavors, and a focus on simple yet flavorful preparations using fresh seasonal produce and high quality meats. Tea acts as both a refreshment and symbol of cultural refinement within Chinese society. I hope this overview provides an interesting starting point for further exploration into the fascinating world of Chinese gastronomy!
|