@@ -36,7 +36,7 @@ class Predictor:
3636
3737 Args:
3838 pdmodel_path (Optional[str]): Path to the PaddlePaddle model file. Defaults to None.
39- pdpiparams_path (Optional[str]): Path to the PaddlePaddle model parameters file. Defaults to None.
39+ pdiparams_path (Optional[str]): Path to the PaddlePaddle model parameters file. Defaults to None.
4040 device (Literal["gpu", "cpu", "npu", "xpu"], optional): Device to use for inference. Defaults to "cpu".
4141 engine (Literal["native", "tensorrt", "onnx", "mkldnn"], optional): Inference engine to use. Defaults to "native".
4242 precision (Literal["fp32", "fp16", "int8"], optional): Precision to use for inference. Defaults to "fp32".
@@ -51,7 +51,7 @@ class Predictor:
5151 def __init__ (
5252 self ,
5353 pdmodel_path : Optional [str ] = None ,
54- pdpiparams_path : Optional [str ] = None ,
54+ pdiparams_path : Optional [str ] = None ,
5555 * ,
5656 device : Literal ["gpu" , "cpu" , "npu" , "xpu" ] = "cpu" ,
5757 engine : Literal ["native" , "tensorrt" , "onnx" , "mkldnn" ] = "native" ,
@@ -65,7 +65,7 @@ def __init__(
6565 num_cpu_threads : int = 10 ,
6666 ):
6767 self .pdmodel_path = pdmodel_path
68- self .pdpiparams_path = pdpiparams_path
68+ self .pdiparams_path = pdiparams_path
6969
7070 self ._check_device (device )
7171 self .device = device
@@ -104,13 +104,13 @@ def _create_paddle_predictor(
104104 f"Given 'pdmodel_path': { self .pdmodel_path } does not exist. "
105105 "Please check if it is correct."
106106 )
107- if not osp .exists (self .pdpiparams_path ):
107+ if not osp .exists (self .pdiparams_path ):
108108 raise FileNotFoundError (
109- f"Given 'pdpiparams_path ': { self .pdpiparams_path } does not exist. "
109+ f"Given 'pdiparams_path ': { self .pdiparams_path } does not exist. "
110110 "Please check if it is correct."
111111 )
112112
113- config = paddle_inference .Config (self .pdmodel_path , self .pdpiparams_path )
113+ config = paddle_inference .Config (self .pdmodel_path , self .pdiparams_path )
114114 if self .device == "gpu" :
115115 config .enable_use_gpu (self .gpu_mem , self .gpu_id )
116116 if self .engine == "tensorrt" :
0 commit comments