File tree 1 file changed +8
-4
lines changed
slm/model_zoo/ernie-vil2.0/deploy/python
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 20
20
from PIL import Image
21
21
22
22
from paddlenlp .transformers import ErnieViLProcessor
23
+ from paddlenlp .utils .env import (
24
+ PADDLE_INFERENCE_MODEL_SUFFIX ,
25
+ PADDLE_INFERENCE_WEIGHTS_SUFFIX ,
26
+ )
23
27
24
28
25
29
def parse_arguments ():
@@ -76,11 +80,11 @@ def __init__(self, args):
76
80
def create_fd_runtime (self , args ):
77
81
option = fd .RuntimeOption ()
78
82
if args .encode_type == "text" :
79
- model_path = os .path .join (args .model_dir , "get_text_features.pdmodel " )
80
- params_path = os .path .join (args .model_dir , "get_text_features.pdiparams " )
83
+ model_path = os .path .join (args .model_dir , f "get_text_features{ PADDLE_INFERENCE_MODEL_SUFFIX } " )
84
+ params_path = os .path .join (args .model_dir , f "get_text_features{ PADDLE_INFERENCE_WEIGHTS_SUFFIX } " )
81
85
else :
82
- model_path = os .path .join (args .model_dir , "get_image_features.pdmodel " )
83
- params_path = os .path .join (args .model_dir , "get_image_features.pdiparams " )
86
+ model_path = os .path .join (args .model_dir , f "get_image_features{ PADDLE_INFERENCE_MODEL_SUFFIX } " )
87
+ params_path = os .path .join (args .model_dir , f "get_image_features{ PADDLE_INFERENCE_WEIGHTS_SUFFIX } " )
84
88
option .set_model_path (model_path , params_path )
85
89
if args .device == "kunlunxin" :
86
90
option .use_kunlunxin ()
You can’t perform that action at this time.
0 commit comments