class_docstr: Handles the ONNX Runtime quantization process for models shared on huggingface.co/models.
class_docstr_tok: ["Handles","the","ONNX","Runtime","quantization","process","for","models","shared","on","huggingface.co\/models","."]
docstr: Args:
      onnx_model_path (`Path`):
          Path to the onnx model files you want to quantize.
      config (`Optional[PretrainedConfig]`, defaults to `None`):
          The configuration of the model.
docstr_tok: ["Args",":","onnx_model_path","(","`","Path","`",")",":","Path","to","the","onnx","model","files","you","want","to","quantize",".","config","(","`","Optional","[","PretrainedConfig","]","`",",","defaults","to","`","None","`",")",":","The","configuration","of","the","model","."]
code: def __init__(
      self,
      onnx_model_path: Path,
      config: Optional["PretrainedConfig"] = None,
  ):
      """
      Args:
          onnx_model_path (`Path`):
              Path to the onnx model files you want to quantize.
          config (`Optional[PretrainedConfig]`, defaults to `None`):
              The configuration of the model.
      """
      super().__init__()
      self.onnx_model_path = onnx_model_path
      self.config = config
      if self.config is None:
          try:
              self.config = AutoConfig.from_pretrained(
                  self.onnx_model_path.parent
              )
          except OSError:
              LOGGER.warning(
                  f"Could not load the config for {self.onnx_model_path} automatically, this might make "
                  "the quantized model harder to use because it will not be able to be loaded by an ORTModel without "
                  "having to specify the configuration explicitly."
              )
      self._calibrator = None
  
imports: import logging
  import os
  from collections import defaultdict
  from pathlib import Path
  from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union
  import onnx
  from datasets import Dataset, load_dataset
  from packaging.version import Version, parse
  from transformers import AutoConfig
  from onnxruntime import __version__
  from onnxruntime.quantization import CalibrationDataReader, QuantFormat, QuantizationMode, QuantType
  from onnxruntime.quantization.onnx_quantizer import ONNXQuantizer
  from onnxruntime.quantization.qdq_quantizer import QDQQuantizer
  from ..quantization_base import OptimumQuantizer
  from ..utils.save_utils import maybe_save_preprocessors
  from .None import ORTQuantizableOperator
  from .configuration import CalibrationConfig, ORTConfig, QuantizationConfig
  from .modeling_ort import ORTModel
  from .modeling_seq2seq import ORTModelForConditionalGeneration
  from .preprocessors import QuantizationPreprocessor
label_desc: Use image node_id 1 to create a new ORTQuantizer object from inherited base classes: OptimumQuantizer with example: obj = ORTQuantizer(onnx_model_path, config)