export¶
-
export_model
(model: paddlenlp.transformers.model_utils.PretrainedModel, input_spec=None, path: Optional[str] = None, model_format: Optional[str] = 'paddle') → Tuple[List[str], List[str]][source]¶ Export paddle inference model or onnx model.
- Parameters
([PretrainedModel] (model) – The model to export.
input_spec (paddle.static.InputSpec, optional) – Describes the input of the saved model’s forward method, which can be described by InputSpec or example Tensor. Default None.
path (Optional[str], optional) – Output dir to save the exported model. Defaults to None.
model_format (Optional[str], optional) – Export model format. There are two options: paddle or onnx, defaults to paddle.