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

Function get_pipeline_input_parameters

modelscope/utils/input_output.py:396–421  ·  view source on GitHub ↗

Get pipeline input and parameter Args: source_file_path (str): The pipeline source code path class_name (str): The pipeline class name

(
    source_file_path: str,
    class_name: str,
)

Source from the content-addressed store, hash-verified

394
395
396def get_pipeline_input_parameters(
397 source_file_path: str,
398 class_name: str,
399):
400 """Get pipeline input and parameter
401
402 Args:
403 source_file_path (str): The pipeline source code path
404 class_name (str): The pipeline class name
405 """
406 with open(source_file_path, 'rb') as f:
407 src = f.read()
408 analyzer = AnalysisSourceFileRegisterModules(source_file_path,
409 class_name)
410 analyzer.visit(
411 ast.parse(
412 src,
413 filename=source_file_path,
414 # python3.7 no type_comments parameter .
415 # type_comments=True
416 ))
417 clz = PipelineClassAnalyzer()
418 clz.visit(analyzer.class_define)
419 input, pipeline_parameters = clz.get_input_parameters()
420 # remove the first input parameter, the input is defined by task.
421 return input, pipeline_parameters
422
423
424meta_type_schema_map = {

Callers 2

_analyzeMethod · 0.85
input_output.pyFile · 0.85

Calls 4

get_input_parametersMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…