File tree 3 files changed +8
-4
lines changed
slm/model_zoo/ernie-layout
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,7 @@ python export_model.py --task_type cls --model_path ./ernie-layoutx-base-uncased
408
408
export/
409
409
├── inference.pdiparams
410
410
├── inference.pdiparams.info
411
- └── inference.pdmodel
411
+ └── inference.json(or inference. pdmodel if PIR is not enabled)
412
412
```
413
413
414
414
<a name =" 52 " ></a >
Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ python export_model.py --task_type cls --model_path ./ernie-layoutx-base-uncased
410
410
export/
411
411
├── inference.pdiparams
412
412
├── inference.pdiparams.info
413
- └── inference.pdmodel
413
+ └── inference.json (在未开启PIR时为inference. pdmodel)
414
414
```
415
415
416
416
<a name =" 52 " ></a >
Original file line number Diff line number Diff line change 25
25
from seqeval .metrics .sequence_labeling import get_entities
26
26
27
27
from paddlenlp .transformers import AutoTokenizer
28
+ from paddlenlp .utils .env import (
29
+ PADDLE_INFERENCE_MODEL_SUFFIX ,
30
+ PADDLE_INFERENCE_WEIGHTS_SUFFIX ,
31
+ )
28
32
from paddlenlp .utils .image_utils import ppocr2example
29
33
from paddlenlp .utils .log import logger
30
34
@@ -33,8 +37,8 @@ class InferBackend(object):
33
37
def __init__ (self , model_path_prefix , device = "cpu" ):
34
38
logger .info (">>> [InferBackend] Creating Engine ..." )
35
39
config = paddle .inference .Config (
36
- model_path_prefix + ".pdmodel " ,
37
- model_path_prefix + ".pdiparams " ,
40
+ model_path_prefix + f" { PADDLE_INFERENCE_MODEL_SUFFIX } " ,
41
+ model_path_prefix + f" { PADDLE_INFERENCE_WEIGHTS_SUFFIX } " ,
38
42
)
39
43
if device == "gpu" :
40
44
config .enable_use_gpu (100 , 0 )
You can’t perform that action at this time.
0 commit comments