OPEA
/

Safetensors
qwen2
4-bit precision
auto-round
sys-lpot-val commited on
Commit
b8e3759
·
1 Parent(s): 7cac2d1

upload auto_round format

Browse files

Signed-off-by: sys-lpot-val <[email protected]>

Files changed (4) hide show
  1. README.md +28 -21
  2. config.json +2 -2
  3. model.safetensors +2 -2
  4. quantization_config.json +2 -2
README.md CHANGED
@@ -1,6 +1,11 @@
 
 
 
 
 
1
  ## Model Details
2
 
3
- This model is an int4 model with group_size 128 of [Qwen/Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) generated by [intel/auto-round](https://github.com/intel/auto-round)
4
 
5
  ## How To Use
6
 
@@ -16,8 +21,9 @@ tokenizer = AutoTokenizer.from_pretrained(quantized_model_dir)
16
 
17
  model = AutoModelForCausalLM.from_pretrained(
18
  quantized_model_dir,
19
- torch_dtype='float16',
20
  device_map="auto",
 
21
  )
22
 
23
  ##import habana_frameworks.torch.core as htcore ## uncommnet it for HPU
@@ -52,9 +58,8 @@ print(response)
52
  prompt = "There is a girl who likes adventure,"
53
  ## INT4:
54
  """That's great to hear! What kind of adventure does the girl like? Is there anything specific she enjoys doing or exploring?"""
55
-
56
  ## BF16:
57
- """That's great to hear! What kind of adventure does the girl like? Is there anything specific she enjoys doing or exploring?"""
58
 
59
 
60
  prompt = "9.11和9.8哪个数字大"
@@ -76,41 +81,43 @@ prompt = "9.11和9.8哪个数字大"
76
 
77
  最终答案:9.8更大。
78
  """
 
79
  ##BF16:
80
  """
81
  要比较9.11和9.8的大小,我们可以按照以下步骤进行:
82
 
83
- 1. 首先,将两个数都转换为相同的小数形式。这里我们使用小数点前的零来方便比较。
84
-
85
- 9.11 = 9.1100 (保留两位小数)
86
- 9.8 = 9.8000 (保留两位小数)
87
-
88
- 2. 现在,比较这两个小数:
89
- - 第一位:9 和 9 相等。
90
- - 第二位:第一位是相同的,都是1。
91
- - 第三位:第一个数是1,第二个数是8,所以8 > 1。
92
 
93
- 因此,9.8大于9.11。
94
 
95
- 最终答案:9.8更大。
96
  """
97
 
98
-
99
  prompt = "Once upon a time,"
100
  ##INT4:
101
  """I'm sorry, but I don't understand what you're asking me to do or what information you want me to provide. Could you please clarify your question or provide more context? I'd be happy to help if you can give me all the information you need."""
102
 
103
  ##BF16:
104
- """I'm sorry, but I don't understand what you're asking me to do or what information you want me to provide. Could you please clarify your question or provide more context? I'd be happy to help if you can give me all the information you need."""
105
 
 
106
 
107
- prompt = "请简短介绍一下阿里巴巴公司"
 
 
108
 
 
 
 
 
109
  ##INT4:
110
  """阿里巴巴集团是全球领先的电子商务和云计算服务提供商,成立于1999年。该公司总部位于中国杭州,并在多个国家和地区设有办事处和运营中心。阿里巴巴集团的业务包括在线零售、移动支付、云计算、人工智能等。阿里巴巴集团是中国最大的电子商务平台之一,也是全球最大的电商平台之一。阿里巴巴集团还拥有众多子公司和品牌,如淘宝、天猫、菜鸟网络等。阿里巴巴集团在全球范围内拥有超过20亿活跃用户,每年销售额超过3500亿美元。阿里巴巴集团致力于通过创新和智能化技术推动商业变革,为消费者提供更便捷、更个性化的购物体验。"""
111
 
112
  ##BF16:
113
- """阿里巴巴集团是全球领先的电子商务和云计算服务提供商,成立于1999年。该公司总部位于中国杭州,并在多个国家和地区设有办事处和运营中心。阿里巴巴集团的业务包括在线零售、移动支付、云计算、人工智能等。阿里巴巴集团是中国最大的电子商务平台之一,也是全球最大的电商平台之一。阿��巴巴集团还拥有众多子公司和品牌,如淘宝、天猫、菜鸟网络等。阿里巴巴集团在全球范围内拥有超过20亿活跃用户,每年销售额超过3500亿美元。阿里巴巴集团致力于通过创新和智能化技术推动商业变革,为消费者提供更便捷、更个性化的购物体验。"""
114
  ```
115
 
116
  ### Evaluate the model
@@ -124,9 +131,9 @@ auto-round --model "OPEA/Qwen2.5-0.5B-Instruct-int4-inc" --eval --eval_bs 16 --
124
  | Metric | BF16 | INT4 |
125
  | :----------------------------------------- | :----: | :----: |
126
  | Avg | 0.4229 | 0.4124 |
 
127
  | leaderboard_ifeval inst_level_strict_acc | 0.3501 | 0.3441 |
128
  | leaderboard_ifeval prompt_level_strict_acc | 0.2107 | 0.2218 |
129
- | leaderboard_mmlu_pro 5 shots | 0.1877 | 0.1678 |
130
  | mmlu | 0.4582 | 0.4434 |
131
  | cmmlu | 0.5033 | 0.4542 |
132
  | ceval-valid | 0.5327 | 0.4918 |
@@ -145,7 +152,7 @@ auto-round --model "OPEA/Qwen2.5-0.5B-Instruct-int4-inc" --eval --eval_bs 16 --
145
 
146
  ### Generate the model
147
 
148
- Here is the sample command to reproduce the model. We observed a larger accuracy drop in Chinese tasks and recommend using a high-quality Chinese dataset for calibration or smaller group_size like 32.
149
 
150
  ```bash
151
  auto-round \
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - NeelNanda/pile-10k
5
+ ---
6
  ## Model Details
7
 
8
+ This model is an int4 model with group_size 128 and symmetric quantization of [Qwen/Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) generated by [intel/auto-round](https://github.com/intel/auto-round). Load the model with `revision="7cac2d1"` to use AutoGPTQ format
9
 
10
  ## How To Use
11
 
 
21
 
22
  model = AutoModelForCausalLM.from_pretrained(
23
  quantized_model_dir,
24
+ torch_dtype='auto',
25
  device_map="auto",
26
+ ##revision="7cac2d1" ##AutoGPTQ format
27
  )
28
 
29
  ##import habana_frameworks.torch.core as htcore ## uncommnet it for HPU
 
58
  prompt = "There is a girl who likes adventure,"
59
  ## INT4:
60
  """That's great to hear! What kind of adventure does the girl like? Is there anything specific she enjoys doing or exploring?"""
 
61
  ## BF16:
62
+ """That's great! What kind of adventure does she like?"""
63
 
64
 
65
  prompt = "9.11和9.8哪个数字大"
 
81
 
82
  最终答案:9.8更大。
83
  """
84
+
85
  ##BF16:
86
  """
87
  要比较9.11和9.8的大小,我们可以按照以下步骤进行:
88
 
89
+ 1. **直接比较**:将两个数相减:
90
+ \[
91
+ 9.11 - 9.8 = -0.69
92
+ \]
 
 
 
 
 
93
 
94
+ 2. **理解结果**:-0.69表示的是一个负数。因为9.11比9.8小。
95
 
96
+ 因此,9.8比9.11大。
97
  """
98
 
 
99
  prompt = "Once upon a time,"
100
  ##INT4:
101
  """I'm sorry, but I don't understand what you're asking me to do or what information you want me to provide. Could you please clarify your question or provide more context? I'd be happy to help if you can give me all the information you need."""
102
 
103
  ##BF16:
104
+ """once upon a time, there was a young girl named Lily who lived in a small village nestled between two mountains. She had always been fascinated by the natural world and dreamed of exploring it further.
105
 
106
+ One day, while wandering through the forest, she stumbled upon an old, mysterious book that seemed to have been written on its pages. As she read, she realized that the book contained secrets about the hidden treasures of the earth.
107
 
108
+ Lily was determined to uncover these secrets and become a true explorer. She spent hours poring over the pages, trying to understand what the author was trying to tell her.
109
+
110
+ Finally, after many days of research and study, Lily discovered the location of the treasure. It lay deep within the heart of the mountain range, guarded by powerful forces that only those with the right knowledge could reach.
111
 
112
+ With great excitement, Lily set out on her journey to find the treasure. She traveled for weeks, crossing treacherous terrain and battling fierce beasts along the way. But even as she"""
113
+
114
+
115
+ prompt = "请简短介绍一下阿里巴巴公司"
116
  ##INT4:
117
  """阿里巴巴集团是全球领先的电子商务和云计算服务提供商,成立于1999年。该公司总部位于中国杭州,并在多个国家和地区设有办事处和运营中心。阿里巴巴集团的业务包括在线零售、移动支付、云计算、人工智能等。阿里巴巴集团是中国最大的电子商务平台之一,也是全球最大的电商平台之一。阿里巴巴集团还拥有众多子公司和品牌,如淘宝、天猫、菜鸟网络等。阿里巴巴集团在全球范围内拥有超过20亿活跃用户,每年销售额超过3500亿美元。阿里巴巴集团致力于通过创新和智能化技术推动商业变革,为消费者提供更便捷、更个性化的购物体验。"""
118
 
119
  ##BF16:
120
+ """阿里巴巴集团是全球最大的电子商务平台之一,成立于1999年。该公司提供包括淘宝、天猫、阿里云等在内的众多产品和服务,是中国乃至全球领先的互联网企业之一。"""
121
  ```
122
 
123
  ### Evaluate the model
 
131
  | Metric | BF16 | INT4 |
132
  | :----------------------------------------- | :----: | :----: |
133
  | Avg | 0.4229 | 0.4124 |
134
+ | leaderboard_mmlu_pro 5 shots | 0.1877 | 0.1678 |
135
  | leaderboard_ifeval inst_level_strict_acc | 0.3501 | 0.3441 |
136
  | leaderboard_ifeval prompt_level_strict_acc | 0.2107 | 0.2218 |
 
137
  | mmlu | 0.4582 | 0.4434 |
138
  | cmmlu | 0.5033 | 0.4542 |
139
  | ceval-valid | 0.5327 | 0.4918 |
 
152
 
153
  ### Generate the model
154
 
155
+ Here is the sample command to generate the model. We observed a larger accuracy drop in Chinese tasks and recommend using a high-quality Chinese dataset for calibration or smaller group_size like 32.
156
 
157
  ```bash
158
  auto-round \
config.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:96f5d8e1d262852583bf8492ba2c4b8d101db7d0d60f8d3e6c7a42f9b36aa4dc
3
- size 1367
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e9dae0baf5b06f44798794cbc7b60eba5588556cca9f507b25cd35a82ac751f
3
+ size 1381
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4e0209a213dc03574cf5f5052e2e4c8726a196bee189b27aea69fb5bcc04cb26
3
- size 459946568
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c71884c6fc5f6c12774e9d1d81b94d78f97266ab40cacf1b54c6b0659adcd45
3
+ size 459383592
quantization_config.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d603e56eb4bb154a31dc23a83f243fc179aeb8631b8a0639837c3d06b06e8d8b
3
- size 569
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f92209e21368ef298866e57e5f3838e7590119ba042ef4c15bf642f7f60e4f40
3
+ size 575