@@ -305,19 +305,25 @@ def validate_and_initialize_user_module(self):
305
305
self .load = load_fn
306
306
self .log_func_implementation_found_or_not (preprocess_fn , INPUT_FN )
307
307
if preprocess_fn is not None :
308
- self .preprocess_extra_arg = self .function_extra_arg (HuggingFaceHandlerService .preprocess , preprocess_fn )
308
+ self .preprocess_extra_arg = self .function_extra_arg (
309
+ HuggingFaceHandlerService .preprocess , preprocess_fn
310
+ )
309
311
self .preprocess = preprocess_fn
310
312
self .log_func_implementation_found_or_not (predict_fn , PREDICT_FN )
311
313
if predict_fn is not None :
312
314
self .predict_extra_arg = self .function_extra_arg (HuggingFaceHandlerService .predict , predict_fn )
313
315
self .predict = predict_fn
314
316
self .log_func_implementation_found_or_not (postprocess_fn , OUTPUT_FN )
315
317
if postprocess_fn is not None :
316
- self .postprocess_extra_arg = self .function_extra_arg (HuggingFaceHandlerService .postprocess , postprocess_fn )
318
+ self .postprocess_extra_arg = self .function_extra_arg (
319
+ HuggingFaceHandlerService .postprocess , postprocess_fn
320
+ )
317
321
self .postprocess = postprocess_fn
318
322
self .log_func_implementation_found_or_not (transform_fn , TRANSFORM_FN )
319
323
if transform_fn is not None :
320
- self .transform_extra_arg = self .function_extra_arg (HuggingFaceHandlerService .transform_fn , transform_fn )
324
+ self .transform_extra_arg = self .function_extra_arg (
325
+ HuggingFaceHandlerService .transform_fn , transform_fn
326
+ )
321
327
self .transform_fn = transform_fn
322
328
else :
323
329
logger .info (
@@ -345,7 +351,7 @@ def function_extra_arg(self, default_func, func):
345
351
default_params = signature (default_func ).parameters
346
352
func_params = signature (func ).parameters
347
353
348
- if ' self' in default_params :
354
+ if " self" in default_params :
349
355
num_default_func_input = len (default_params ) - 1
350
356
else :
351
357
num_default_func_input = len (default_params )
0 commit comments