legraphista
commited on
Commit
β’
b8bb5ac
1
Parent(s):
9bb24fe
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: microsoft/Phi-3-mini-4k-instruct
|
3 |
+
inference: false
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
library_name: gguf
|
7 |
+
license: mit
|
8 |
+
license_link: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/LICENSE
|
9 |
+
pipeline_tag: text-generation
|
10 |
+
quantized_by: legraphista
|
11 |
+
tags:
|
12 |
+
- nlp
|
13 |
+
- code
|
14 |
+
- quantized
|
15 |
+
- GGUF
|
16 |
+
- quantization
|
17 |
+
- imat
|
18 |
+
- imatrix
|
19 |
+
- static
|
20 |
+
- 16bit
|
21 |
+
- 8bit
|
22 |
+
- 6bit
|
23 |
+
- 5bit
|
24 |
+
- 4bit
|
25 |
+
- 3bit
|
26 |
+
- 2bit
|
27 |
+
- 1bit
|
28 |
+
---
|
29 |
+
|
30 |
+
# Phi-3-mini-4k-instruct-IMat-GGUF
|
31 |
+
_Llama.cpp imatrix quantization of microsoft/Phi-3-mini-4k-instruct_
|
32 |
+
|
33 |
+
Original Model: [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct)
|
34 |
+
Original dtype: `BF16` (`bfloat16`)
|
35 |
+
Quantized by: llama.cpp [b3286](https://github.com/ggerganov/llama.cpp/releases/tag/b3286)
|
36 |
+
IMatrix dataset: [here](https://gist.githubusercontent.com/bartowski1182/eb213dccb3571f863da82e99418f81e8/raw/b2869d80f5c16fd7082594248e80144677736635/calibration_datav3.txt)
|
37 |
+
|
38 |
+
- [Files](#files)
|
39 |
+
- [IMatrix](#imatrix)
|
40 |
+
- [Common Quants](#common-quants)
|
41 |
+
- [All Quants](#all-quants)
|
42 |
+
- [Downloading using huggingface-cli](#downloading-using-huggingface-cli)
|
43 |
+
- [Inference](#inference)
|
44 |
+
- [Simple chat template](#simple-chat-template)
|
45 |
+
- [Chat template with system prompt](#chat-template-with-system-prompt)
|
46 |
+
- [Llama.cpp](#llama-cpp)
|
47 |
+
- [FAQ](#faq)
|
48 |
+
- [Why is the IMatrix not applied everywhere?](#why-is-the-imatrix-not-applied-everywhere)
|
49 |
+
- [How do I merge a split GGUF?](#how-do-i-merge-a-split-gguf)
|
50 |
+
|
51 |
+
---
|
52 |
+
|
53 |
+
## Files
|
54 |
+
|
55 |
+
### IMatrix
|
56 |
+
Status: β³ Processing
|
57 |
+
Link: [here](https://huggingface.co/legraphista/Phi-3.1-mini-4k-instruct/blob/main/imatrix.dat)
|
58 |
+
|
59 |
+
### Common Quants
|
60 |
+
| Filename | Quant type | File Size | Status | Uses IMatrix | Is Split |
|
61 |
+
| -------- | ---------- | --------- | ------ | ------------ | -------- |
|
62 |
+
| Phi-3-mini-4k-instruct.Q8_0 | Q8_0 | - | β³ Processing | βͺ Static | -
|
63 |
+
| Phi-3-mini-4k-instruct.Q6_K | Q6_K | - | β³ Processing | βͺ Static | -
|
64 |
+
| Phi-3-mini-4k-instruct.Q4_K | Q4_K | - | β³ Processing | π’ IMatrix | -
|
65 |
+
| Phi-3-mini-4k-instruct.Q3_K | Q3_K | - | β³ Processing | π’ IMatrix | -
|
66 |
+
| Phi-3-mini-4k-instruct.Q2_K | Q2_K | - | β³ Processing | π’ IMatrix | -
|
67 |
+
|
68 |
+
|
69 |
+
### All Quants
|
70 |
+
| Filename | Quant type | File Size | Status | Uses IMatrix | Is Split |
|
71 |
+
| -------- | ---------- | --------- | ------ | ------------ | -------- |
|
72 |
+
| Phi-3-mini-4k-instruct.BF16 | BF16 | - | β³ Processing | βͺ Static | -
|
73 |
+
| Phi-3-mini-4k-instruct.FP16 | F16 | - | β³ Processing | βͺ Static | -
|
74 |
+
| Phi-3-mini-4k-instruct.Q8_0 | Q8_0 | - | β³ Processing | βͺ Static | -
|
75 |
+
| Phi-3-mini-4k-instruct.Q6_K | Q6_K | - | β³ Processing | βͺ Static | -
|
76 |
+
| Phi-3-mini-4k-instruct.Q5_K | Q5_K | - | β³ Processing | βͺ Static | -
|
77 |
+
| Phi-3-mini-4k-instruct.Q5_K_S | Q5_K_S | - | β³ Processing | βͺ Static | -
|
78 |
+
| Phi-3-mini-4k-instruct.Q4_K | Q4_K | - | β³ Processing | π’ IMatrix | -
|
79 |
+
| Phi-3-mini-4k-instruct.Q4_K_S | Q4_K_S | - | β³ Processing | π’ IMatrix | -
|
80 |
+
| Phi-3-mini-4k-instruct.IQ4_NL | IQ4_NL | - | β³ Processing | π’ IMatrix | -
|
81 |
+
| Phi-3-mini-4k-instruct.IQ4_XS | IQ4_XS | - | β³ Processing | π’ IMatrix | -
|
82 |
+
| Phi-3-mini-4k-instruct.Q3_K | Q3_K | - | β³ Processing | π’ IMatrix | -
|
83 |
+
| Phi-3-mini-4k-instruct.Q3_K_L | Q3_K_L | - | β³ Processing | π’ IMatrix | -
|
84 |
+
| Phi-3-mini-4k-instruct.Q3_K_S | Q3_K_S | - | β³ Processing | π’ IMatrix | -
|
85 |
+
| Phi-3-mini-4k-instruct.IQ3_M | IQ3_M | - | β³ Processing | π’ IMatrix | -
|
86 |
+
| Phi-3-mini-4k-instruct.IQ3_S | IQ3_S | - | β³ Processing | π’ IMatrix | -
|
87 |
+
| Phi-3-mini-4k-instruct.IQ3_XS | IQ3_XS | - | β³ Processing | π’ IMatrix | -
|
88 |
+
| Phi-3-mini-4k-instruct.IQ3_XXS | IQ3_XXS | - | β³ Processing | π’ IMatrix | -
|
89 |
+
| Phi-3-mini-4k-instruct.Q2_K | Q2_K | - | β³ Processing | π’ IMatrix | -
|
90 |
+
| Phi-3-mini-4k-instruct.Q2_K_S | Q2_K_S | - | β³ Processing | π’ IMatrix | -
|
91 |
+
| Phi-3-mini-4k-instruct.IQ2_M | IQ2_M | - | β³ Processing | π’ IMatrix | -
|
92 |
+
| Phi-3-mini-4k-instruct.IQ2_S | IQ2_S | - | β³ Processing | π’ IMatrix | -
|
93 |
+
| Phi-3-mini-4k-instruct.IQ2_XS | IQ2_XS | - | β³ Processing | π’ IMatrix | -
|
94 |
+
| Phi-3-mini-4k-instruct.IQ2_XXS | IQ2_XXS | - | β³ Processing | π’ IMatrix | -
|
95 |
+
| Phi-3-mini-4k-instruct.IQ1_M | IQ1_M | - | β³ Processing | π’ IMatrix | -
|
96 |
+
| Phi-3-mini-4k-instruct.IQ1_S | IQ1_S | - | β³ Processing | π’ IMatrix | -
|
97 |
+
|
98 |
+
|
99 |
+
## Downloading using huggingface-cli
|
100 |
+
If you do not have hugginface-cli installed:
|
101 |
+
```
|
102 |
+
pip install -U "huggingface_hub[cli]"
|
103 |
+
```
|
104 |
+
Download the specific file you want:
|
105 |
+
```
|
106 |
+
huggingface-cli download legraphista/Phi-3.1-mini-4k-instruct --include "Phi-3-mini-4k-instruct.Q8_0.gguf" --local-dir ./
|
107 |
+
```
|
108 |
+
If the model file is big, it has been split into multiple files. In order to download them all to a local folder, run:
|
109 |
+
```
|
110 |
+
huggingface-cli download legraphista/Phi-3.1-mini-4k-instruct --include "Phi-3-mini-4k-instruct.Q8_0/*" --local-dir ./
|
111 |
+
# see FAQ for merging GGUF's
|
112 |
+
```
|
113 |
+
|
114 |
+
---
|
115 |
+
|
116 |
+
## Inference
|
117 |
+
|
118 |
+
### Simple chat template
|
119 |
+
```
|
120 |
+
<|user|>
|
121 |
+
{user_prompt}<|end|>
|
122 |
+
<|assistant|>
|
123 |
+
{assistant_response}<|end|>
|
124 |
+
<|user|>
|
125 |
+
{next_user_prompt}<|end|>
|
126 |
+
<|endoftext|>
|
127 |
+
```
|
128 |
+
|
129 |
+
### Chat template with system prompt
|
130 |
+
```
|
131 |
+
<|system|>
|
132 |
+
{system_prompt}<|end|>
|
133 |
+
<|user|>
|
134 |
+
{user_prompt}<|end|>
|
135 |
+
<|assistant|>
|
136 |
+
{assistant_response}<|end|>
|
137 |
+
<|user|>
|
138 |
+
{next_user_prompt}<|end|>
|
139 |
+
<|endoftext|>
|
140 |
+
```
|
141 |
+
|
142 |
+
### Llama.cpp
|
143 |
+
```
|
144 |
+
llama.cpp/main -m Phi-3-mini-4k-instruct.Q8_0.gguf --color -i -p "prompt here (according to the chat template)"
|
145 |
+
```
|
146 |
+
|
147 |
+
---
|
148 |
+
|
149 |
+
## FAQ
|
150 |
+
|
151 |
+
### Why is the IMatrix not applied everywhere?
|
152 |
+
According to [this investigation](https://www.reddit.com/r/LocalLLaMA/comments/1993iro/ggufs_quants_can_punch_above_their_weights_now/), it appears that lower quantizations are the only ones that benefit from the imatrix input (as per hellaswag results).
|
153 |
+
|
154 |
+
### How do I merge a split GGUF?
|
155 |
+
1. Make sure you have `gguf-split` available
|
156 |
+
- To get hold of `gguf-split`, navigate to https://github.com/ggerganov/llama.cpp/releases
|
157 |
+
- Download the appropriate zip for your system from the latest release
|
158 |
+
- Unzip the archive and you should be able to find `gguf-split`
|
159 |
+
2. Locate your GGUF chunks folder (ex: `Phi-3-mini-4k-instruct.Q8_0`)
|
160 |
+
3. Run `gguf-split --merge Phi-3-mini-4k-instruct.Q8_0/Phi-3-mini-4k-instruct.Q8_0-00001-of-XXXXX.gguf Phi-3-mini-4k-instruct.Q8_0.gguf`
|
161 |
+
- Make sure to point `gguf-split` to the first chunk of the split.
|
162 |
+
|
163 |
+
---
|
164 |
+
|
165 |
+
Got a suggestion? Ping me [@legraphista](https://x.com/legraphista)!
|