@@ -153,11 +153,11 @@ python infer_cpu.py --task_name seq_cls --model_path ./tnews_pruned_infer_model/
153
153
```
154
154
input data: 未来自动驾驶真的会让酒驾和疲劳驾驶成历史吗?
155
155
seq cls result:
156
- label: news_car confidence: 0.9929346442222595
156
+ label: news_car confidence: 0.5543532371520996
157
157
-----------------------------
158
158
input data: 黄磊接受华少快问快答,不光智商逆天,情商也不逊黄渤
159
159
seq cls result:
160
- label: news_entertainment confidence: 0.998711347579956
160
+ label: news_entertainment confidence: 0.9495906829833984
161
161
-----------------------------
162
162
```
163
163
和命名实体识别模型推理类似,开启动态量化的命令如下:
@@ -168,11 +168,11 @@ python infer_cpu.py --task_name seq_cls --model_path ./tnews_pruned_infer_model/
168
168
```
169
169
input data: 未来自动驾驶真的会让酒驾和疲劳驾驶成历史吗?
170
170
seq cls result:
171
- label: news_car confidence: 0.9910931587219238
171
+ label: news_car confidence: 0.5778735876083374
172
172
-----------------------------
173
173
input data: 黄磊接受华少快问快答,不光智商逆天,情商也不逊黄渤
174
174
seq cls result:
175
- label: news_entertainment confidence: 0.9977021813392639
175
+ label: news_entertainment confidence: 0.9206441044807434
176
176
-----------------------------
177
177
```
178
178
### 3.3 GPU端推理样例
@@ -184,11 +184,11 @@ python infer_gpu.py --task_name seq_cls --model_path ./tnews_pruned_infer_model/
184
184
```
185
185
input data: 未来自动驾驶真的会让酒驾和疲劳驾驶成历史吗?
186
186
seq cls result:
187
- label: news_car confidence: 0.9929346442222595
187
+ label: news_car confidence: 0.5543532371520996
188
188
-----------------------------
189
189
input data: 黄磊接受华少快问快答,不光智商逆天,情商也不逊黄渤
190
190
seq cls result:
191
- label: news_entertainment confidence: 0.998711347579956
191
+ label: news_entertainment confidence: 0.9495906829833984
192
192
-----------------------------
193
193
```
194
194
如果需要FP16进行加速,可以开启use_fp16开关,具体命令为
@@ -202,11 +202,11 @@ python infer_gpu.py --task_name seq_cls --model_path ./tnews_pruned_infer_model/
202
202
```
203
203
input data: 未来自动驾驶真的会让酒驾和疲劳驾驶成历史吗?
204
204
seq cls result:
205
- label: news_car confidence: 0.9929342269897461
205
+ label: news_car confidence: 0.5536671876907349
206
206
-----------------------------
207
207
input data: 黄磊接受华少快问快答,不光智商逆天,情商也不逊黄渤
208
208
seq cls result:
209
- label: news_entertainment confidence: 0.99870365858078
209
+ label: news_entertainment confidence: 0.9494127035140991
210
210
-----------------------------
211
211
```
212
212
如果需要进行INT8量化加速,还需要使用量化脚本对训练好的FP32模型进行量化,然后使用量化后的模型进行部署,模型的量化请参考:[ 模型量化脚本使用说明] ( ./../../README.md#模型压缩 ) ,也可下载我们量化后的INT8模型进行部署,请执行如下命令获取模型:
@@ -226,10 +226,10 @@ python infer_gpu.py --task_name seq_cls --model_path ./tnews_quant_infer_model/i
226
226
```
227
227
input data: 未来自动驾驶真的会让酒驾和疲劳驾驶成历史吗?
228
228
seq cls result:
229
- label: news_car confidence: 0.9922153353691101
229
+ label: news_car confidence: 0.5510320067405701
230
230
-----------------------------
231
231
input data: 黄磊接受华少快问快答,不光智商逆天,情商也不逊黄渤
232
232
seq cls result:
233
- label: news_entertainment confidence: 0.9986827373504639
233
+ label: news_entertainment confidence: 0.9432708024978638
234
234
-----------------------------
235
235
```
0 commit comments