CTranslate2Exporter

class opennmt.utils.CTranslate2Exporter(quantization=None)[source]

CTranslate2 exporter.

Inherits from: opennmt.utils.Exporter

Extended by:

__init__(quantization=None)[source]

Initializes the exporter.

Parameters

quantization – Quantize model weights to this type when exporting the model. Can be “int8”, “int16”, “float16”, or “int8_float16”. Default is no quantization.

Raises
  • ImportError – if the CTranslate2 package is missing.

  • ValueError – if quantization is invalid.