Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
Signed-off-by: Mengni Wang <[email protected]>
  • Loading branch information
mengniwang95 committed Aug 15, 2024
1 parent 98ac3c2 commit 4f66e64
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ function init_params {
do
case $var in
--input_model=*)
input_model=$(echo $var |cut -f2 -d=)
input_model=$(echo "$var" |cut -f2 -d=)
;;
--batch_size=*)
batch_size=$(echo $var |cut -f2 -d=)
batch_size=$(echo "$var" |cut -f2 -d=)
;;
--tokenizer=*)
tokenizer=$(echo $var |cut -f2 -d=)
tokenizer=$(echo "$var" |cut -f2 -d=)
;;
--mode=*)
mode=$(echo $var |cut -f2 -d=)
mode=$(echo "$var" |cut -f2 -d=)
;;
--intra_op_num_threads=*)
intra_op_num_threads=$(echo $var |cut -f2 -d=)
intra_op_num_threads=$(echo "$var" |cut -f2 -d=)
;;
esac
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ function init_params {
do
case $var in
--input_model=*)
input_model=$(echo $var |cut -f2 -d=)
input_model=$(echo "$var" |cut -f2 -d=)
;;
--output_model=*)
output_model=$(echo $var |cut -f2 -d=)
output_model=$(echo "$var" |cut -f2 -d=)
;;
--batch_size=*)
batch_size=$(echo $var |cut -f2 -d=)
batch_size=$(echo "$var" |cut -f2 -d=)
;;
--dataset=*)
dataset=$(echo $var |cut -f2 -d=)
dataset=$(echo "$var" |cut -f2 -d=)
;;
--tokenizer=*)
tokenizer=$(echo $var |cut -f2 -d=)
tokenizer=$(echo "$var" |cut -f2 -d=)
;;
--algorithm=*)
algorithm=$(echo $var |cut -f2 -d=)
algorithm=$(echo "$var" |cut -f2 -d=)
;;
--quant_format=*)
quant_format=$(echo $var |cut -f2 -d=)
quant_format=$(echo "$var" |cut -f2 -d=)
;;
esac
done
Expand Down
4 changes: 3 additions & 1 deletion onnx_neural_compressor/quantization/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class ExampleAlgorithmConfig:

return config_registry.register_config_impl(algo_name=algo_name, priority=priority)


class Encoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, quantization.QuantType):
Expand All @@ -209,7 +210,8 @@ def default(self, o):
if isinstance(o, quantization.CalibrationMethod):
return getattr(o, "name")
return super().default(o)



class BaseConfig(ABC):
"""The base config for all algorithm configs."""

Expand Down
1 change: 1 addition & 0 deletions test/quantization/test_algorithm_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ def test_is_B_transposed(self):
)
self.assertFalse(quant_utils.is_B_transposed(node))


if __name__ == "__main__":
unittest.main()

0 comments on commit 4f66e64

Please sign in to comment.