@@ -182,7 +182,7 @@ class MultimodalFeatureExtractionTask(Task):
182
182
},
183
183
}
184
184
185
- def __init__ (self , task , model , batch_size = 1 , _static_mode = True , return_tensors = True , ** kwargs ):
185
+ def __init__ (self , task , model , batch_size = 1 , is_static_model = True , return_tensors = True , ** kwargs ):
186
186
super ().__init__ (task = task , model = model , ** kwargs )
187
187
self ._seed = None
188
188
# we do not use batch
@@ -191,14 +191,14 @@ def __init__(self, task, model, batch_size=1, _static_mode=True, return_tensors=
191
191
self .return_tensors = return_tensors
192
192
self ._check_task_files ()
193
193
self ._construct_tokenizer ()
194
- self ._static_mode = _static_mode
194
+ self .is_static_model = is_static_model
195
195
self ._config_map = {}
196
196
self .predictor_map = {}
197
197
self .input_names_map = {}
198
198
self .input_handles_map = {}
199
199
self .output_handle_map = {}
200
200
self ._check_predictor_type ()
201
- if self ._static_mode :
201
+ if self .is_static_model :
202
202
self ._get_inference_model ()
203
203
else :
204
204
self ._construct_model (model )
@@ -228,7 +228,7 @@ def _parse_batch(batch_examples):
228
228
else :
229
229
batch_texts = None
230
230
batch_images = batch_examples
231
- if self ._static_mode :
231
+ if self .is_static_model :
232
232
tokenized_inputs = self ._processor (
233
233
text = batch_texts , images = batch_images , return_tensors = "np" , padding = "max_length" , truncation = True
234
234
)
@@ -287,7 +287,7 @@ def _run_model(self, inputs):
287
287
Run the task model from the outputs of the `_preprocess` function.
288
288
"""
289
289
all_feats = []
290
- if self ._static_mode :
290
+ if self .is_static_model :
291
291
with static_mode_guard ():
292
292
for batch_inputs in inputs ["batches" ]:
293
293
if self ._predictor_type == "paddle-inference" :
0 commit comments