afrideva commited on
Commit
3166a45
β€’
1 Parent(s): 079ac5b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +93 -0
README.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: GeneZC/MiniMA-3B
3
+ datasets:
4
+ - EleutherAI/pile
5
+ - togethercomputer/RedPajama-Data-1T
6
+ - p208p2002/wudao
7
+ inference: false
8
+ language:
9
+ - en
10
+ - zh
11
+ library_name: transformers
12
+ license: apache-2.0
13
+ model_creator: GeneZC
14
+ model_name: MiniMA-3B
15
+ pipeline_tag: text-generation
16
+ quantized_by: afrideva
17
+ tags:
18
+ - gguf
19
+ - ggml
20
+ - quantized
21
+ - q2_k
22
+ - q3_k_m
23
+ - q4_k_m
24
+ - q5_k_m
25
+ - q6_k
26
+ - q8_0
27
+ ---
28
+ # GeneZC/MiniMA-3B-GGUF
29
+
30
+ Quantized GGUF model files for [MiniMA-3B](https://huggingface.co/GeneZC/MiniMA-3B) from [GeneZC](https://huggingface.co/GeneZC)
31
+
32
+
33
+ | Name | Quant method | Size |
34
+ | ---- | ---- | ---- |
35
+ | [minima-3b.q2_k.gguf](https://huggingface.co/afrideva/MiniMA-3B-GGUF/resolve/main/minima-3b.q2_k.gguf) | q2_k | 1.30 GB |
36
+ | [minima-3b.q3_k_m.gguf](https://huggingface.co/afrideva/MiniMA-3B-GGUF/resolve/main/minima-3b.q3_k_m.gguf) | q3_k_m | 1.51 GB |
37
+ | [minima-3b.q4_k_m.gguf](https://huggingface.co/afrideva/MiniMA-3B-GGUF/resolve/main/minima-3b.q4_k_m.gguf) | q4_k_m | 1.85 GB |
38
+ | [minima-3b.q5_k_m.gguf](https://huggingface.co/afrideva/MiniMA-3B-GGUF/resolve/main/minima-3b.q5_k_m.gguf) | q5_k_m | 2.15 GB |
39
+ | [minima-3b.q6_k.gguf](https://huggingface.co/afrideva/MiniMA-3B-GGUF/resolve/main/minima-3b.q6_k.gguf) | q6_k | 2.48 GB |
40
+ | [minima-3b.q8_0.gguf](https://huggingface.co/afrideva/MiniMA-3B-GGUF/resolve/main/minima-3b.q8_0.gguf) | q8_0 | 3.21 GB |
41
+
42
+
43
+
44
+ ## Original Model Card:
45
+ ## MiniMA-3B
46
+
47
+ πŸ“‘ [arXiv]() | πŸ€— [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)
48
+
49
+ ❗ Must comply with LICENSE of LLaMA2 since it is derived from LLaMA2.
50
+
51
+ A language model distilled from an adapted version of LLaMA2-7B following "Towards the Law of Capacity Gap in Distilling Language Models".
52
+
53
+ Establishing a new compute-performance pareto frontier.
54
+
55
+ <img src="./teaser_a.jpg" alt="teaser_a" width="700" />
56
+
57
+ The following is an example code snippet to use MiniMA-3B:
58
+
59
+ ```python
60
+ import torch
61
+
62
+ from transformers import AutoModelForCausalLM, AutoTokenizer
63
+
64
+ # MiniMA
65
+ tokenizer = AutoTokenizer.from_pretrained("GeneZC/MiniMA-3B", use_fast=False)
66
+ # GPU.
67
+ model = AutoModelForCausalLM.from_pretrained("GeneZC/MiniMA-3B", use_cache=True, device_map="auto", torch_dtype=torch.float16).eval()
68
+ # CPU.
69
+ # model = AutoModelForCausalLM.from_pretrained("GeneZC/MiniMA-3B", use_cache=True, device_map="cpu", torch_dtype=torch.float16).eval()
70
+
71
+ prompt = "Question: Sherrie tells the truth. Vernell says Sherrie tells the truth. Alexis says Vernell lies. Michaela says Alexis tells the truth. Elanor says Michaela tells the truth. Does Elanor tell the truth?\nAnswer: No\n\nQuestion: Kristian lies. Sherrie says Kristian lies. Delbert says Sherrie lies. Jerry says Delbert tells the truth. Shalonda says Jerry tells the truth. Does Shalonda tell the truth?\nAnswer: No\n\nQuestion: Vina tells the truth. Helene says Vina lies. Kandi says Helene tells the truth. Jamey says Kandi lies. Ka says Jamey lies. Does Ka tell the truth?\nAnswer: No\n\nQuestion: Christie tells the truth. Ka says Christie tells the truth. Delbert says Ka lies. Leda says Delbert tells the truth. Lorine says Leda tells the truth. Does Lorine tell the truth?\nAnswer:"
72
+ input_ids = tokenizer([prompt]).input_ids
73
+ output_ids = model.generate(
74
+ torch.as_tensor(input_ids).cuda(),
75
+ do_sample=True,
76
+ temperature=0.7,
77
+ max_new_tokens=1024,
78
+ )
79
+ output_ids = output_ids[0][len(input_ids[0]):]
80
+ output = tokenizer.decode(output_ids, skip_special_tokens=True).strip()
81
+ # output: "No"
82
+ ```
83
+
84
+ ## Bibtex
85
+
86
+ ```bibtex
87
+ @article{zhang2023law,
88
+ title={Towards the Law of Capacity Gap in Distilling Language Models},
89
+ author={Zhang, Chen and Song, Dawei and Ye, Zheyu and Gao, Yan},
90
+ year={2023},
91
+ url={}
92
+ }
93
+ ```