Skip to content

Commit 46ebe6e

Browse files
authored
[PIR] Fix lexical_analysis (#10470)
1 parent d80bce0 commit 46ebe6e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

slm/examples/lexical_analysis/deploy/predict.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
import paddle
2020

2121
from paddlenlp.data import Pad, Stack, Tuple
22+
from paddlenlp.utils.env import (
23+
PADDLE_INFERENCE_MODEL_SUFFIX,
24+
PADDLE_INFERENCE_WEIGHTS_SUFFIX,
25+
)
2226

2327
# yapf: disable
2428
parser = argparse.ArgumentParser(__doc__)
25-
parser.add_argument("--model_file", type=str, required=True, default='./static_graph_params.pdmodel', help="The path to model info in static graph.")
26-
parser.add_argument("--params_file", type=str, required=True, default='./static_graph_params.pdiparams', help="The path to parameters in static graph.")
29+
parser.add_argument("--model_file", type=str, required=True, default=f'./static_graph_params{PADDLE_INFERENCE_MODEL_SUFFIX}', help="The path to model info in static graph.")
30+
parser.add_argument("--params_file", type=str, required=True, default=f'./static_graph_params{PADDLE_INFERENCE_WEIGHTS_SUFFIX}', help="The path to parameters in static graph.")
2731
parser.add_argument("--data_dir", type=str, default=None, help="The folder where the dataset is located.")
2832
parser.add_argument("--init_checkpoint", type=str, default=None, help="Path to init model.")
2933
parser.add_argument("--batch_size", type=int, default=2, help="The number of sequences contained in a mini-batch.")

0 commit comments

Comments
 (0)