Skip to content

Commit d5b9856

Browse files
authored
[PIR] update document_intelligence.py (#10394)
1 parent 045115a commit d5b9856

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

slm/pipelines/pipelines/nodes/document/document_intelligence.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
sort_res,
3030
)
3131
from paddlenlp.transformers import AutoTokenizer
32-
from paddlenlp.utils.env import PPNLP_HOME
32+
from paddlenlp.utils.env import (
33+
PADDLE_INFERENCE_MODEL_SUFFIX,
34+
PADDLE_INFERENCE_WEIGHTS_SUFFIX,
35+
PPNLP_HOME,
36+
)
3337

3438
logger = logging.getLogger(__name__)
3539

@@ -94,8 +98,8 @@ def __init__(
9498

9599
def _get_inference_model(self):
96100
inference_model_path = os.path.join(self._task_path, "static", "inference")
97-
self._static_model_file = inference_model_path + ".pdmodel"
98-
self._static_params_file = inference_model_path + ".pdiparams"
101+
self._static_model_file = inference_model_path + f"{PADDLE_INFERENCE_MODEL_SUFFIX}"
102+
self._static_params_file = inference_model_path + f"{PADDLE_INFERENCE_WEIGHTS_SUFFIX}"
99103
self._config = paddle.inference.Config(self._static_model_file, self._static_params_file)
100104
self._prepare_static_mode()
101105

0 commit comments

Comments
 (0)