# Define a customized Metric function
from neural_compressor.experimental import Quantization, common
from neural_compressor.experimental.metric import BaseMetric


class MyMetric(BaseMetric):
    def __init__(self, *args):
        pass

    def update(self, predict, label):
        pass

    def reset(self):
        pass

    def result(self):
        pass

# Quantize with customized dataloader and metric
quantizer = Quantization('{{config_path}}')
quantizer.model = '{{model_path}}'
quantizer.metric = common.Metric(metric_cls=MyMetric, name='my_metric')
quantized_model = quantizer.fit()
quantized_model.save('{{model_output_path}}')
