afrideva commited on
Commit
bf87f7c
β€’
1 Parent(s): 4db267e

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +137 -0
README.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: GeneZC/MiniChat-2-3B
3
+ inference: false
4
+ language:
5
+ - en
6
+ - zh
7
+ library_name: transformers
8
+ license: apache-2.0
9
+ model_creator: GeneZC
10
+ model_name: MiniChat-2-3B
11
+ pipeline_tag: text-generation
12
+ quantized_by: afrideva
13
+ tags:
14
+ - gguf
15
+ - ggml
16
+ - quantized
17
+ - q2_k
18
+ - q3_k_m
19
+ - q4_k_m
20
+ - q5_k_m
21
+ - q6_k
22
+ - q8_0
23
+ widget:
24
+ - text: "<s> [|User|] Hi \U0001F44B </s>[|Assistant|]"
25
+ ---
26
+ # GeneZC/MiniChat-2-3B-GGUF
27
+
28
+ Quantized GGUF model files for [MiniChat-2-3B](https://huggingface.co/GeneZC/MiniChat-2-3B) from [GeneZC](https://huggingface.co/GeneZC)
29
+
30
+
31
+ | Name | Quant method | Size |
32
+ | ---- | ---- | ---- |
33
+ | [minichat-2-3b.fp16.gguf](https://huggingface.co/afrideva/MiniChat-2-3B-GGUF/resolve/main/minichat-2-3b.fp16.gguf) | fp16 | 6.04 GB |
34
+ | [minichat-2-3b.q2_k.gguf](https://huggingface.co/afrideva/MiniChat-2-3B-GGUF/resolve/main/minichat-2-3b.q2_k.gguf) | q2_k | 1.30 GB |
35
+ | [minichat-2-3b.q3_k_m.gguf](https://huggingface.co/afrideva/MiniChat-2-3B-GGUF/resolve/main/minichat-2-3b.q3_k_m.gguf) | q3_k_m | 1.51 GB |
36
+ | [minichat-2-3b.q4_k_m.gguf](https://huggingface.co/afrideva/MiniChat-2-3B-GGUF/resolve/main/minichat-2-3b.q4_k_m.gguf) | q4_k_m | 1.85 GB |
37
+ | [minichat-2-3b.q5_k_m.gguf](https://huggingface.co/afrideva/MiniChat-2-3B-GGUF/resolve/main/minichat-2-3b.q5_k_m.gguf) | q5_k_m | 2.15 GB |
38
+ | [minichat-2-3b.q6_k.gguf](https://huggingface.co/afrideva/MiniChat-2-3B-GGUF/resolve/main/minichat-2-3b.q6_k.gguf) | q6_k | 2.48 GB |
39
+ | [minichat-2-3b.q8_0.gguf](https://huggingface.co/afrideva/MiniChat-2-3B-GGUF/resolve/main/minichat-2-3b.q8_0.gguf) | q8_0 | 3.21 GB |
40
+
41
+
42
+
43
+ ## Original Model Card:
44
+ ## MiniChat-2-3B
45
+
46
+ πŸ“‘ [arXiv](https://arxiv.org/abs/2311.07052) | πŸ‘» [GitHub](https://github.com/GeneZC/MiniMA) | πŸ€— [HuggingFace-MiniMA](https://huggingface.co/GeneZC/MiniMA-3B) | πŸ€— [HuggingFace-MiniChat](https://huggingface.co/GeneZC/MiniChat-3B) | πŸ€– [ModelScope-MiniMA](https://modelscope.cn/models/GeneZC/MiniMA-3B) | πŸ€– [ModelScope-MiniChat](https://modelscope.cn/models/GeneZC/MiniChat-3B) | πŸ€— [HuggingFace-MiniChat-1.5](https://huggingface.co/GeneZC/MiniChat-1.5-3B) | πŸ€— [HuggingFace-MiniMA-2](https://huggingface.co/GeneZC/MiniMA-2-3B) | πŸ€— [HuggingFace-MiniChat-2](https://huggingface.co/GeneZC/MiniChat-2-3B)
47
+
48
+ πŸ†• **Updates from MiniChat-3B**:
49
+ - better base model MiniMA-2-3B;
50
+ - better data mixture;
51
+ - use of [NEFTune](https://arxiv.org/abs/2310.05914);
52
+ - use of [DPO](https://arxiv.org/abs/2305.18290).
53
+
54
+ ❗ Must comply with LICENSE of LLaMA2 since it is derived from LLaMA2.
55
+
56
+ A language model continued from MiniMA-3B and finetuned on both instruction and preference data.
57
+
58
+ Surpassing Vicuna-7B and approximating LLaMA-2-Chat-7B on MT-Bench.
59
+
60
+ <img src="./teaser_b.jpg" alt="teaser_b" width="687" />
61
+
62
+ **Standard Benchmarks**
63
+
64
+ |Method|TFLOPs|MMLU (5-shot)|CEval (5-shot)|DROP (3-shot)|HumanEval (0-shot)|BBH (3-shot)|GSM8K (8-shot)|
65
+ |--|--|--|--|--|--|--|--|
66
+ |Mamba-2.8B|4.6E9|25.58|24.74|15.72|7.32|29.37|3.49|
67
+ |ShearedLLaMA-2.7B|0.8E9|26.97|22.88|19.98|4.88|30.48|3.56|
68
+ |BTLM-3B|11.3E9|27.20|26.00|17.84|10.98|30.87|4.55|
69
+ |StableLM-3B|72.0E9|44.75|31.05|22.35|15.85|32.59|10.99|
70
+ |Qwen-1.8B|23.8E9|44.05|54.75|12.97|14.02|30.80|22.97|
71
+ |Phi-2-2.8B|159.9E9|56.74|34.03|30.74|46.95|44.13|55.42|
72
+ |LLaMA-2-7B|84.0E9|46.00|34.40|31.57|12.80|32.02|14.10|
73
+ ||
74
+ |MiniMA-3B|4.0E9|28.51|28.23|22.50|10.98|31.61|8.11|
75
+ |MiniChat-3B|4.0E9|38.40|36.48|22.58|18.29|31.36|29.72|
76
+ |MiniMA-2-3B|13.4E9|40.14|44.65|23.10|14.63|31.43|8.87|
77
+ |MiniChat-2-3B|13.4E9|46.17|43.91|30.26|22.56|34.95|38.13|
78
+
79
+ **Instruction-following Benchmarks**
80
+
81
+ |Method|AlpacaEval|MT-Bench|
82
+ |--|--|--|
83
+ |GPT-4|95.28|9.18|
84
+ |Zephyr-7B-Beta|90.60|7.34|
85
+ |Phi-2-DPO|81.37|-|
86
+ |StableLM Zephyr 3B|76.00|6.64|
87
+ |Vicuna-7B|76.84|6.17|
88
+ |LLaMA-2-Chat-7B|71.37|6.27|
89
+ ||
90
+ |MiniChat-3B|48.82|-|
91
+ |MiniChat-2-3B|77.30|6.23|
92
+
93
+ The following is an example code snippet to use MiniChat-2-3B:
94
+
95
+ ```python
96
+ import torch
97
+
98
+ from transformers import AutoModelForCausalLM, AutoTokenizer
99
+
100
+ from conversation import get_default_conv_template
101
+
102
+ # MiniChat
103
+ tokenizer = AutoTokenizer.from_pretrained("GeneZC/MiniChat-2-3B", use_fast=False)
104
+ # GPU.
105
+ model = AutoModelForCausalLM.from_pretrained("GeneZC/MiniChat-2-3B", use_cache=True, device_map="auto", torch_dtype=torch.float16).eval()
106
+ # CPU.
107
+ # model = AutoModelForCausalLM.from_pretrained("GeneZC/MiniChat-2-3B", use_cache=True, device_map="cpu", torch_dtype=torch.float16).eval()
108
+
109
+ conv = get_default_conv_template("minichat")
110
+
111
+ question = "Implement a program to find the common elements in two arrays without using any extra data structures."
112
+ conv.append_message(conv.roles[0], question)
113
+ conv.append_message(conv.roles[1], None)
114
+ prompt = conv.get_prompt()
115
+ input_ids = tokenizer([prompt]).input_ids
116
+ output_ids = model.generate(
117
+ torch.as_tensor(input_ids).cuda(),
118
+ do_sample=True,
119
+ temperature=0.7,
120
+ max_new_tokens=1024,
121
+ )
122
+ output_ids = output_ids[0][len(input_ids[0]):]
123
+ output = tokenizer.decode(output_ids, skip_special_tokens=True).strip()
124
+ # output: "def common_elements(arr1, arr2):\n if len(arr1) == 0:\n return []\n if len(arr2) == 0:\n return arr1\n\n common_elements = []\n for element in arr1:\n if element in arr2:\n common_elements.append(element)\n\n return common_elements"
125
+ # Multiturn conversation could be realized by continuously appending questions to `conv`.
126
+ ```
127
+
128
+ ## Bibtex
129
+
130
+ ```bibtex
131
+ @article{zhang2023law,
132
+ title={Towards the Law of Capacity Gap in Distilling Language Models},
133
+ author={Zhang, Chen and Song, Dawei and Ye, Zheyu and Gao, Yan},
134
+ year={2023},
135
+ url={https://arxiv.org/abs/2311.07052}
136
+ }
137
+ ```