laszlokiss27
commited on
Commit
•
46e0b62
1
Parent(s):
7d1cc27
update
Browse files- decoder_model_merged_quantized.onnx.onnx +3 -0
- quantifiy.py +11 -0
decoder_model_merged_quantized.onnx.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fe9751468ddf78017d5bbb317d1162049b57bc8b11321dcf3756907835245e42
|
3 |
+
size 20201510
|
quantifiy.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import onnx
|
2 |
+
from onnxruntime.quantization import quantize_dynamic, QuantType
|
3 |
+
|
4 |
+
# Load the original init_decoder_model
|
5 |
+
model_path = "decoder_model.onnx"
|
6 |
+
quantized_model_path = "decoder_quantized.onnx"
|
7 |
+
|
8 |
+
# Perform dynamic quantization on the model
|
9 |
+
quantize_dynamic(model_path, quantized_model_path, weight_type=QuantType.QInt8)
|
10 |
+
|
11 |
+
print(f"Quantized model saved to {quantized_model_path}")
|