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

Function call_pipeline_with_json

modelscope/utils/input_output.py:635–653  ·  view source on GitHub ↗

Call pipeline with json input. Args: pipeline_info (PipelineInfomation): The pipeline information object. pipeline (Pipeline): The pipeline object. body (Dict): The input object, include input and parameters

(pipeline_info: PipelineInfomation,
                            pipeline: Pipeline, body: str)

Source from the content-addressed store, hash-verified

633
634
635def call_pipeline_with_json(pipeline_info: PipelineInfomation,
636 pipeline: Pipeline, body: str):
637 """Call pipeline with json input.
638
639 Args:
640 pipeline_info (PipelineInfomation): The pipeline information object.
641 pipeline (Pipeline): The pipeline object.
642 body (Dict): The input object, include input and parameters
643 """
644 # TODO: is_custom_call misjudgment
645 # if pipeline_info.is_custom_call:
646 # pipeline_inputs = body['input']
647 # result = pipeline(**pipeline_inputs)
648 # else:
649 pipeline_inputs, parameters = service_base64_input_to_pipeline_input(
650 pipeline_info['task_name'], body)
651 result = pipeline(pipeline_inputs, **parameters)
652
653 return result
654
655
656def service_base64_input_to_pipeline_input(task_name, body):

Callers 3

check_modelMethod · 0.90
inferenceFunction · 0.90
test_singleMethod · 0.90

Calls 2

pipelineFunction · 0.90

Tested by 1

test_singleMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…