RichardErkhov commited on
Commit
4f20b12
1 Parent(s): ce53904

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +137 -0
README.md ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ Qwen2-0.5B-Instruct - GGUF
11
+ - Model creator: https://huggingface.co/Qwen/
12
+ - Original model: https://huggingface.co/Qwen/Qwen2-0.5B-Instruct/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [Qwen2-0.5B-Instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q2_K.gguf) | Q2_K | 0.32GB |
18
+ | [Qwen2-0.5B-Instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.IQ3_XS.gguf) | IQ3_XS | 0.32GB |
19
+ | [Qwen2-0.5B-Instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.IQ3_S.gguf) | IQ3_S | 0.32GB |
20
+ | [Qwen2-0.5B-Instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q3_K_S.gguf) | Q3_K_S | 0.32GB |
21
+ | [Qwen2-0.5B-Instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.IQ3_M.gguf) | IQ3_M | 0.32GB |
22
+ | [Qwen2-0.5B-Instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q3_K.gguf) | Q3_K | 0.33GB |
23
+ | [Qwen2-0.5B-Instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q3_K_M.gguf) | Q3_K_M | 0.33GB |
24
+ | [Qwen2-0.5B-Instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q3_K_L.gguf) | Q3_K_L | 0.34GB |
25
+ | [Qwen2-0.5B-Instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.IQ4_XS.gguf) | IQ4_XS | 0.33GB |
26
+ | [Qwen2-0.5B-Instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q4_0.gguf) | Q4_0 | 0.33GB |
27
+ | [Qwen2-0.5B-Instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.IQ4_NL.gguf) | IQ4_NL | 0.33GB |
28
+ | [Qwen2-0.5B-Instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q4_K_S.gguf) | Q4_K_S | 0.36GB |
29
+ | [Qwen2-0.5B-Instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q4_K.gguf) | Q4_K | 0.37GB |
30
+ | [Qwen2-0.5B-Instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q4_K_M.gguf) | Q4_K_M | 0.37GB |
31
+ | [Qwen2-0.5B-Instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q4_1.gguf) | Q4_1 | 0.35GB |
32
+ | [Qwen2-0.5B-Instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q5_0.gguf) | Q5_0 | 0.37GB |
33
+ | [Qwen2-0.5B-Instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q5_K_S.gguf) | Q5_K_S | 0.38GB |
34
+ | [Qwen2-0.5B-Instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q5_K.gguf) | Q5_K | 0.39GB |
35
+ | [Qwen2-0.5B-Instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q5_K_M.gguf) | Q5_K_M | 0.39GB |
36
+ | [Qwen2-0.5B-Instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q5_1.gguf) | Q5_1 | 0.39GB |
37
+ | [Qwen2-0.5B-Instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q6_K.gguf) | Q6_K | 0.47GB |
38
+ | [Qwen2-0.5B-Instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/Qwen_-_Qwen2-0.5B-Instruct-gguf/blob/main/Qwen2-0.5B-Instruct.Q8_0.gguf) | Q8_0 | 0.49GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ license: apache-2.0
46
+ language:
47
+ - en
48
+ pipeline_tag: text-generation
49
+ tags:
50
+ - chat
51
+ ---
52
+
53
+ # Qwen2-0.5B-Instruct
54
+
55
+ ## Introduction
56
+
57
+ Qwen2 is the new series of Qwen large language models. For Qwen2, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters, including a Mixture-of-Experts model. This repo contains the instruction-tuned 0.5B Qwen2 model.
58
+
59
+ Compared with the state-of-the-art opensource language models, including the previous released Qwen1.5, Qwen2 has generally surpassed most opensource models and demonstrated competitiveness against proprietary models across a series of benchmarks targeting for language understanding, language generation, multilingual capability, coding, mathematics, reasoning, etc.
60
+
61
+ For more details, please refer to our [blog](https://qwenlm.github.io/blog/qwen2/), [GitHub](https://github.com/QwenLM/Qwen2), and [Documentation](https://qwen.readthedocs.io/en/latest/).
62
+ <br>
63
+
64
+ ## Model Details
65
+ Qwen2 is a language model series including decoder language models of different model sizes. For each size, we release the base language model and the aligned chat model. It is based on the Transformer architecture with SwiGLU activation, attention QKV bias, group query attention, etc. Additionally, we have an improved tokenizer adaptive to multiple natural languages and codes.
66
+
67
+ ## Training details
68
+ We pretrained the models with a large amount of data, and we post-trained the models with both supervised finetuning and direct preference optimization.
69
+
70
+
71
+ ## Requirements
72
+ The code of Qwen2 has been in the latest Hugging face transformers and we advise you to install `transformers>=4.37.0`, or you might encounter the following error:
73
+ ```
74
+ KeyError: 'qwen2'
75
+ ```
76
+
77
+ ## Quickstart
78
+
79
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
80
+
81
+ ```python
82
+ from transformers import AutoModelForCausalLM, AutoTokenizer
83
+ device = "cuda" # the device to load the model onto
84
+
85
+ model = AutoModelForCausalLM.from_pretrained(
86
+ "Qwen/Qwen2-0.5B-Instruct",
87
+ torch_dtype="auto",
88
+ device_map="auto"
89
+ )
90
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2-0.5B-Instruct")
91
+
92
+ prompt = "Give me a short introduction to large language model."
93
+ messages = [
94
+ {"role": "system", "content": "You are a helpful assistant."},
95
+ {"role": "user", "content": prompt}
96
+ ]
97
+ text = tokenizer.apply_chat_template(
98
+ messages,
99
+ tokenize=False,
100
+ add_generation_prompt=True
101
+ )
102
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
103
+
104
+ generated_ids = model.generate(
105
+ model_inputs.input_ids,
106
+ max_new_tokens=512
107
+ )
108
+ generated_ids = [
109
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
110
+ ]
111
+
112
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
113
+ ```
114
+
115
+ ## Evaluation
116
+
117
+ We briefly compare Qwen2-0.5B-Instruct with Qwen1.5-0.5B-Chat. The results are as follows:
118
+
119
+ | Datasets | Qwen1.5-0.5B-Chat | **Qwen2-0.5B-Instruct** | Qwen1.5-1.8B-Chat | **Qwen2-1.5B-Instruct** |
120
+ | :--- | :---: | :---: | :---: | :---: |
121
+ | MMLU | 35.0 | **37.9** | 43.7 | **52.4** |
122
+ | HumanEval | 9.1 | **17.1** | 25.0 | **37.8** |
123
+ | GSM8K | 11.3 | **40.1** | 35.3 | **61.6** |
124
+ | C-Eval | 37.2 | **45.2** | 55.3 | **63.8** |
125
+ | IFEval (Prompt Strict-Acc.) | 14.6 | **20.0** | 16.8 | **29.0** |
126
+
127
+ ## Citation
128
+
129
+ If you find our work helpful, feel free to give us a cite.
130
+
131
+ ```
132
+ @article{qwen2,
133
+ title={Qwen2 Technical Report},
134
+ year={2024}
135
+ }
136
+ ```
137
+