bartowski commited on
Commit
9c4ea0c
1 Parent(s): 0653a08

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +41 -71
README.md CHANGED
@@ -1,7 +1,6 @@
1
  ---
2
  license: mit
3
  license_link: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/LICENSE
4
-
5
  language:
6
  - en
7
  pipeline_tag: text-generation
@@ -16,95 +15,66 @@ widget:
16
  - role: user
17
  content: Can you provide ways to eat combinations of bananas and dragonfruits?
18
  quantized_by: bartowski
 
 
 
 
 
 
 
 
 
 
19
  ---
 
20
 
21
- ## Llamacpp imatrix Quantizations of Phi-3.1-mini-4k-instruct
22
-
23
- <b>I'm calling this Phi-3.1 because Microsoft made the decision to release a huge update in place.. So yes, it's the new model from June 2nd 2024, but I've renamed it for clarity.</b>
24
-
25
- Using <a href="https://github.com/ggerganov/llama.cpp/">llama.cpp</a> release <a href="https://github.com/ggerganov/llama.cpp/releases/tag/b3278">b3278</a> for quantization.
26
-
27
- Original model: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct
28
 
29
- All quants made using imatrix option with dataset from [here](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8)
 
 
30
 
31
- ## Prompt format
 
 
32
 
33
- ```
34
- <|system|> {system_prompt}<|end|><|user|> {prompt}<|end|><|assistant|>
35
- ```
36
 
37
- ## Download a file (not the whole branch) from below:
38
-
39
- | Filename | Quant type | File Size | Description |
40
- | -------- | ---------- | --------- | ----------- |
41
- | [Phi-3.1-mini-4k-instruct-Q8_0_L.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q8_1.gguf) | Q8_0_L | 4.24GB | *Experimental*, uses f16 for embed and output weights. Please provide any feedback of differences. Extremely high quality, generally unneeded but max available quant. |
42
- | [Phi-3.1-mini-4k-instruct-Q8_0.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q8_0.gguf) | Q8_0 | 4.06GB | Extremely high quality, generally unneeded but max available quant. |
43
- | [Phi-3.1-mini-4k-instruct-Q6_K_L.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q6_K_L.gguf) | Q6_K_L | 3.36GB | *Experimental*, uses f16 for embed and output weights. Please provide any feedback of differences. Very high quality, near perfect, *recommended*. |
44
- | [Phi-3.1-mini-4k-instruct-Q6_K.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q6_K.gguf) | Q6_K | 3.13GB | Very high quality, near perfect, *recommended*. |
45
- | [Phi-3.1-mini-4k-instruct-Q5_K_L.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q5_K_L.gguf) | Q5_K_L | 3.06GB | *Experimental*, uses f16 for embed and output weights. Please provide any feedback of differences. High quality, *recommended*. |
46
- | [Phi-3.1-mini-4k-instruct-Q5_K_M.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q5_K_M.gguf) | Q5_K_M | 2.81GB | High quality, *recommended*. |
47
- | [Phi-3.1-mini-4k-instruct-Q5_K_S.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q5_K_S.gguf) | Q5_K_S | 2.64GB | High quality, *recommended*. |
48
- | [Phi-3.1-mini-4k-instruct-Q4_K_L.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q4_K_L.gguf) | Q4_K_L | 2.65GB | *Experimental*, uses f16 for embed and output weights. Please provide any feedback of differences. Good quality, uses about 4.83 bits per weight, *recommended*. |
49
- | [Phi-3.1-mini-4k-instruct-Q4_K_M.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q4_K_M.gguf) | Q4_K_M | 2.39GB | Good quality, uses about 4.83 bits per weight, *recommended*. |
50
- | [Phi-3.1-mini-4k-instruct-Q4_K_S.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q4_K_S.gguf) | Q4_K_S | 2.18GB | Slightly lower quality with more space savings, *recommended*. |
51
- | [Phi-3.1-mini-4k-instruct-IQ4_XS.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-IQ4_XS.gguf) | IQ4_XS | 2.05GB | Decent quality, smaller than Q4_K_S with similar performance, *recommended*. |
52
- | [Phi-3.1-mini-4k-instruct-Q3_K_XL.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q3_K_XL.gguf) | Q3_K_XL | 2.35GB | *Experimental*, uses f16 for embed and output weights. Please provide any feedback of differences. Lower quality but usable, good for low RAM availability. |
53
- | [Phi-3.1-mini-4k-instruct-Q3_K_L.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q3_K_L.gguf) | Q3_K_L | 2.08GB | Lower quality but usable, good for low RAM availability. |
54
- | [Phi-3.1-mini-4k-instruct-Q3_K_M.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q3_K_M.gguf) | Q3_K_M | 1.95GB | Even lower quality. |
55
- | [Phi-3.1-mini-4k-instruct-IQ3_M.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-IQ3_M.gguf) | IQ3_M | 1.85GB | Medium-low quality, new method with decent performance comparable to Q3_K_M. |
56
- | [Phi-3.1-mini-4k-instruct-Q3_K_S.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q3_K_S.gguf) | Q3_K_S | 1.68GB | Low quality, not recommended. |
57
- | [Phi-3.1-mini-4k-instruct-IQ3_XS.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-IQ3_XS.gguf) | IQ3_XS | 1.62GB | Lower quality, new method with decent performance, slightly better than Q3_K_S. |
58
- | [Phi-3.1-mini-4k-instruct-IQ3_XXS.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-IQ3_XXS.gguf) | IQ3_XXS | 1.51GB | Lower quality, new method with decent performance, comparable to Q3 quants. |
59
- | [Phi-3.1-mini-4k-instruct-Q2_K.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-Q2_K.gguf) | Q2_K | 1.41GB | Very low quality but surprisingly usable. |
60
- | [Phi-3.1-mini-4k-instruct-IQ2_M.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-IQ2_M.gguf) | IQ2_M | 1.31GB | Very low quality, uses SOTA techniques to also be surprisingly usable. |
61
- | [Phi-3.1-mini-4k-instruct-IQ2_S.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-IQ2_S.gguf) | IQ2_S | 1.21GB | Very low quality, uses SOTA techniques to be usable. |
62
- | [Phi-3.1-mini-4k-instruct-IQ2_XS.gguf](https://huggingface.co/bartowski/Phi-3.1-mini-4k-instruct-GGUF/blob/main/Phi-3.1-mini-4k-instruct-IQ2_XS.gguf) | IQ2_XS | 1.15GB | Very low quality, uses SOTA techniques to be usable. |
63
-
64
- ## Downloading using huggingface-cli
65
-
66
- First, make sure you have hugginface-cli installed:
67
 
68
- ```
69
- pip install -U "huggingface_hub[cli]"
70
- ```
71
 
72
- Then, you can target the specific file you want:
73
 
74
  ```
75
- huggingface-cli download bartowski/Phi-3.1-mini-4k-instruct-GGUF --include "Phi-3.1-mini-4k-instruct-Q4_K_M.gguf" --local-dir ./
 
 
 
 
76
  ```
77
 
78
- If the model is bigger than 50GB, it will have been split into multiple files. In order to download them all to a local folder, run:
79
-
80
- ```
81
- huggingface-cli download bartowski/Phi-3.1-mini-4k-instruct-GGUF --include "Phi-3.1-mini-4k-instruct-Q8_0.gguf/*" --local-dir Phi-3.1-mini-4k-instruct-Q8_0
82
- ```
83
-
84
- You can either specify a new local-dir (Phi-3.1-mini-4k-instruct-Q8_0) or download them all in place (./)
85
-
86
- ## Which file should I choose?
87
-
88
- A great write up with charts showing various performances is provided by Artefact2 [here](https://gist.github.com/Artefact2/b5f810600771265fc1e39442288e8ec9)
89
-
90
- The first thing to figure out is how big a model you can run. To do this, you'll need to figure out how much RAM and/or VRAM you have.
91
 
92
- If you want your model running as FAST as possible, you'll want to fit the whole thing on your GPU's VRAM. Aim for a quant with a file size 1-2GB smaller than your GPU's total VRAM.
93
 
94
- If you want the absolute maximum quality, add both your system RAM and your GPU's VRAM together, then similarly grab a quant with a file size 1-2GB Smaller than that total.
95
 
96
- Next, you'll need to decide if you want to use an 'I-quant' or a 'K-quant'.
 
 
 
97
 
98
- If you don't want to think too much, grab one of the K-quants. These are in format 'QX_K_X', like Q5_K_M.
99
 
100
- If you want to get more into the weeds, you can check out this extremely useful feature chart:
101
 
102
- [llama.cpp feature matrix](https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix)
103
 
104
- But basically, if you're aiming for below Q4, and you're running cuBLAS (Nvidia) or rocBLAS (AMD), you should look towards the I-quants. These are in format IQX_X, like IQ3_M. These are newer and offer better performance for their size.
105
 
106
- These I-quants can also be used on CPU and Apple Metal, but will be slower than their K-quant equivalent, so speed vs performance is a tradeoff you'll have to decide.
107
 
108
- The I-quants are *not* compatible with Vulcan, which is also AMD, so if you have an AMD card double check if you're using the rocBLAS build or the Vulcan build. At the time of writing this, LM Studio has a preview with ROCm support, and other inference engines have specific builds for ROCm.
109
 
110
- Want to support my work? Visit my ko-fi page here: https://ko-fi.com/bartowski
 
1
  ---
2
  license: mit
3
  license_link: https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/resolve/main/LICENSE
 
4
  language:
5
  - en
6
  pipeline_tag: text-generation
 
15
  - role: user
16
  content: Can you provide ways to eat combinations of bananas and dragonfruits?
17
  quantized_by: bartowski
18
+ lm_studio:
19
+ param_count: 4b
20
+ use_case: chat
21
+ release_date: 02-07-2024
22
+ model_creator: Microsoft
23
+ prompt_template: Phi 3
24
+ system_prompt: You are a helpful AI assistant.
25
+ base_model: Phi
26
+ original_repo: microsoft/Phi-3-mini-4k-instruct
27
+ base_model: microsoft/Phi-3-mini-4k-instruct
28
  ---
29
+ ## 💫 Community Model> Phi-3.1 mini 4k instruct by Microsoft
30
 
31
+ *👾 [LM Studio](https://lmstudio.ai) Community models highlights program. Highlighting new & noteworthy models by the community. Join the conversation on [Discord](https://discord.gg/aPQfnNkxGC)*.
 
 
 
 
 
 
32
 
33
+ **Model creator:** [Microsoft](https://huggingface.co/microsoft)<br>
34
+ **Original model**: [Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct)<br>
35
+ **GGUF quantization:** provided by [bartowski](https://huggingface.co/bartowski) based on `llama.cpp` release [b3278](https://github.com/ggerganov/llama.cpp/releases/tag/b3278)<br>
36
 
37
+ ## Model Summary:
38
+ Though the name was left as Phi-3 in Microsoft's release, this is NOT the same model as before! It features massive improvements across a range of benchmarks, so we've renamed it as Phi-3.1 for clarity.<br>
39
+ This update used additional post-training data which improved instruction following, structuring output, multi-turn conversations, explicitly support <|system|> tag, and significantly improve reasoning capability.<br>
40
 
41
+ This model is tuned with common sense, language understanding, math, code, long conteext, and logical reasoning as the primary focus.
 
 
42
 
43
+ ## Prompt template:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
+ Choose the `Phi 3` preset in your LM Studio.
 
 
46
 
47
+ Under the hood, the model will see a prompt that's formatted like so:
48
 
49
  ```
50
+ <|system|>
51
+ You are a helpful AI assistant.<|end|>
52
+ <|user|>
53
+ {prompt}<|end|>
54
+ <|assistant|>
55
  ```
56
 
57
+ ## Technical Details
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
+ Phi-3.1 Mini-4K-Instruct has 3.8B parameters and is a dense decoder-only Transformer model. The model is fine-tuned with Supervised fine-tuning (SFT) and Direct Preference Optimization (DPO) to ensure alignment with human preferences and safety guidlines.
60
 
61
+ Context length: 4K tokens
62
 
63
+ This model was trained on 3.3T tokens of data and is a combination:
64
+ - publicly available documents that were filtered rigorously for quality, selected high-quality educational data, and code
65
+ - Newly created synthetic, “textbook-like” data for the purpose of teaching math, coding, common sense reasoning, general knowledge of the world (science, daily activities, theory of mind, etc.)
66
+ - High quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
67
 
68
+ Phi 3.1 features additional tuning based on customer feedback, emphasizing instruction following, structure output, multi-turn conversation quality, explicitly support <|system|> tag, and significantly improve reasoning capability.
69
 
70
+ Find more details on the arXiv report [here](https://arxiv.org/abs/2404.14219)
71
 
72
+ ## Special thanks
73
 
74
+ 🙏 Special thanks to [Georgi Gerganov](https://github.com/ggerganov) and the whole team working on [llama.cpp](https://github.com/ggerganov/llama.cpp/) for making all of this possible.
75
 
76
+ 🙏 Special thanks to [Kalomaze](https://github.com/kalomaze) for his dataset (linked [here](https://github.com/ggerganov/llama.cpp/discussions/5263)) that was used for calculating the imatrix for the IQ1_M and IQ2_XS quants, which makes them usable even at their tiny size!
77
 
78
+ ## Disclaimers
79
 
80
+ LM Studio is not the creator, originator, or owner of any Model featured in the Community Model Program. Each Community Model is created and provided by third parties. LM Studio does not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Community Model. You understand that Community Models can produce content that might be offensive, harmful, inaccurate or otherwise inappropriate, or deceptive. Each Community Model is the sole responsibility of the person or entity who originated such Model. LM Studio may not monitor or control the Community Models and cannot, and does not, take responsibility for any such Model. LM Studio disclaims all warranties or guarantees about the accuracy, reliability or benefits of the Community Models. LM Studio further disclaims any warranty that the Community Model will meet your requirements, be secure, uninterrupted or available at any time or location, or error-free, viruses-free, or that any errors will be corrected, or otherwise. You will be solely responsible for any damage resulting from your use of or access to the Community Models, your downloading of any Community Model, or use of any other Community Model provided by or through LM Studio.