afrideva commited on
Commit
2b44d63
β€’
1 Parent(s): 584f7e7

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +105 -0
README.md ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: GeneZC/MiniChat-1.5-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-1.5-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-1.5-3B-GGUF
27
+
28
+ Quantized GGUF model files for [MiniChat-1.5-3B](https://huggingface.co/GeneZC/MiniChat-1.5-3B) from [GeneZC](https://huggingface.co/GeneZC)
29
+
30
+
31
+ | Name | Quant method | Size |
32
+ | ---- | ---- | ---- |
33
+ | [minichat-1.5-3b.fp16.gguf](https://huggingface.co/afrideva/MiniChat-1.5-3B-GGUF/resolve/main/minichat-1.5-3b.fp16.gguf) | fp16 | 6.04 GB |
34
+ | [minichat-1.5-3b.q2_k.gguf](https://huggingface.co/afrideva/MiniChat-1.5-3B-GGUF/resolve/main/minichat-1.5-3b.q2_k.gguf) | q2_k | 1.30 GB |
35
+ | [minichat-1.5-3b.q3_k_m.gguf](https://huggingface.co/afrideva/MiniChat-1.5-3B-GGUF/resolve/main/minichat-1.5-3b.q3_k_m.gguf) | q3_k_m | 1.51 GB |
36
+ | [minichat-1.5-3b.q4_k_m.gguf](https://huggingface.co/afrideva/MiniChat-1.5-3B-GGUF/resolve/main/minichat-1.5-3b.q4_k_m.gguf) | q4_k_m | 1.85 GB |
37
+ | [minichat-1.5-3b.q5_k_m.gguf](https://huggingface.co/afrideva/MiniChat-1.5-3B-GGUF/resolve/main/minichat-1.5-3b.q5_k_m.gguf) | q5_k_m | 2.15 GB |
38
+ | [minichat-1.5-3b.q6_k.gguf](https://huggingface.co/afrideva/MiniChat-1.5-3B-GGUF/resolve/main/minichat-1.5-3b.q6_k.gguf) | q6_k | 2.48 GB |
39
+ | [minichat-1.5-3b.q8_0.gguf](https://huggingface.co/afrideva/MiniChat-1.5-3B-GGUF/resolve/main/minichat-1.5-3b.q8_0.gguf) | q8_0 | 3.21 GB |
40
+
41
+
42
+
43
+ ## Original Model Card:
44
+ ## MiniChat-1.5-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) | πŸ€— [HuggingFace-MiniChat-1.5](https://huggingface.co/GeneZC/MiniChat-1.5-3B) | πŸ€– [ModelScope-MiniMA](https://modelscope.cn/models/GeneZC/MiniMA-3B) | πŸ€– [ModelScope-MiniChat](https://modelscope.cn/models/GeneZC/MiniChat-3B)
47
+
48
+ πŸ†• **Updates from MiniChat-3B**:
49
+ - better data mixture;
50
+ - use of [NEFTune](https://arxiv.org/abs/2310.05914);
51
+ - use of [DPO](https://arxiv.org/abs/2305.18290).
52
+
53
+ ❗ Must comply with LICENSE of LLaMA2 since it is derived from LLaMA2.
54
+
55
+ A language model distilled and finetuned from an adapted version of LLaMA2-7B following "Towards the Law of Capacity Gap in Distilling Language Models".
56
+
57
+ Outperforming a wide range of 3B competitors in GPT4 evaluation and even competing with several 7B chat models.
58
+
59
+ <img src="./teaser_b.jpg" alt="teaser_b" width="687" />
60
+
61
+ The following is an example code snippet to use MiniChat-3B:
62
+
63
+ ```python
64
+ import torch
65
+
66
+ from transformers import AutoModelForCausalLM, AutoTokenizer
67
+
68
+ from conversation import get_default_conv_template
69
+
70
+ # MiniChat
71
+ tokenizer = AutoTokenizer.from_pretrained("GeneZC/MiniChat-3B", use_fast=False)
72
+ # GPU.
73
+ model = AutoModelForCausalLM.from_pretrained("GeneZC/MiniChat-3B", use_cache=True, device_map="auto", torch_dtype=torch.float16).eval()
74
+ # CPU.
75
+ # model = AutoModelForCausalLM.from_pretrained("GeneZC/MiniChat-3B", use_cache=True, device_map="cpu", torch_dtype=torch.float16).eval()
76
+
77
+ conv = get_default_conv_template("minichat")
78
+
79
+ question = "Implement a program to find the common elements in two arrays without using any extra data structures."
80
+ conv.append_message(conv.roles[0], question)
81
+ conv.append_message(conv.roles[1], None)
82
+ prompt = conv.get_prompt()
83
+ input_ids = tokenizer([prompt]).input_ids
84
+ output_ids = model.generate(
85
+ torch.as_tensor(input_ids).cuda(),
86
+ do_sample=True,
87
+ temperature=0.7,
88
+ max_new_tokens=1024,
89
+ )
90
+ output_ids = output_ids[0][len(input_ids[0]):]
91
+ output = tokenizer.decode(output_ids, skip_special_tokens=True).strip()
92
+ # 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"
93
+ # Multiturn conversation could be realized by continuously appending questions to `conv`.
94
+ ```
95
+
96
+ ## Bibtex
97
+
98
+ ```bibtex
99
+ @article{zhang2023law,
100
+ title={Towards the Law of Capacity Gap in Distilling Language Models},
101
+ author={Zhang, Chen and Song, Dawei and Ye, Zheyu and Gao, Yan},
102
+ year={2023},
103
+ url={https://arxiv.org/abs/2311.07052}
104
+ }
105
+ ```