mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-19 05:54:20 +00:00
applied PR #1152 to other recipes
This commit is contained in:
parent
3cfd75c4db
commit
c03c011230
@ -613,7 +613,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -608,7 +608,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -508,7 +508,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -518,7 +518,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -63,8 +63,8 @@ import sentencepiece as spm
|
|||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from conformer import Conformer
|
from conformer import Conformer
|
||||||
from onnxruntime.quantization import QuantType, quantize_dynamic
|
|
||||||
from decoder import Decoder
|
from decoder import Decoder
|
||||||
|
from onnxruntime.quantization import QuantType, quantize_dynamic
|
||||||
from scaling_converter import convert_scaled_to_non_scaled
|
from scaling_converter import convert_scaled_to_non_scaled
|
||||||
from train import add_model_arguments, get_params, get_transducer_model
|
from train import add_model_arguments, get_params, get_transducer_model
|
||||||
|
|
||||||
@ -662,7 +662,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ import sentencepiece as spm
|
|||||||
import torch
|
import torch
|
||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
from conformer import Conformer
|
from conformer import Conformer
|
||||||
from onnxruntime.quantization import QuantType, quantize_dynamic
|
|
||||||
from decoder import Decoder
|
from decoder import Decoder
|
||||||
|
from onnxruntime.quantization import QuantType, quantize_dynamic
|
||||||
from scaling_converter import convert_scaled_to_non_scaled
|
from scaling_converter import convert_scaled_to_non_scaled
|
||||||
from train import add_model_arguments, get_params, get_transducer_model
|
from train import add_model_arguments, get_params, get_transducer_model
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -661,7 +661,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -652,7 +652,7 @@ def main():
|
|||||||
quantize_dynamic(
|
quantize_dynamic(
|
||||||
model_input=decoder_filename,
|
model_input=decoder_filename,
|
||||||
model_output=decoder_filename_int8,
|
model_output=decoder_filename_int8,
|
||||||
op_types_to_quantize=["MatMul"],
|
op_types_to_quantize=["MatMul", "Gather"],
|
||||||
weight_type=QuantType.QInt8,
|
weight_type=QuantType.QInt8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user