MCPcopy Create free account
hub / github.com/modelscope/modelscope / forward

Method forward

modelscope/pipelines/base.py:421–427  ·  view source on GitHub ↗

Provide default implementation using self.model and user can reimplement it

(self, inputs: Dict[str, Any],
                **forward_params)

Source from the content-addressed store, hash-verified

419 return self.preprocessor(inputs, **preprocess_params)
420
421 def forward(self, inputs: Dict[str, Any],
422 **forward_params) -> Dict[str, Any]:
423 """ Provide default implementation using self.model and user can reimplement it
424 """
425 assert self.model is not None, 'forward method should be implemented'
426 assert not self.has_multiple_models, 'default implementation does not support multiple models in a pipeline.'
427 return self.model(inputs, **forward_params)
428
429 def postprocess(self, inputs: Dict[str, Any],
430 **post_params) -> Dict[str, Any]:

Callers 7

_process_singleMethod · 0.95
_process_batchMethod · 0.95
_validate_onnx_modelMethod · 0.45
export_saved_modelMethod · 0.45
_validate_onnx_modelMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected