def build_pipeline_model(
        dc_pipeline: 'towhee.RuntimePipeline',
        model_root: str,
        format_priority: list,
        parallelism: int = 8,
        server: str = 'triton'
    ):
    """
    Build the pipeline as a model.

    Args:
        dc_pipeline ('towhee.RuntimePipeline'):
            The piepline to build as a model.
        model_root (`str`):
            The model root path.
        format_priority (`list`):
            The priority order of the model format.
        parallelism (`int`):
            The parallel number.
        server (`str`):
            The server type.

    Examples:
        >>> import towhee
        >>> from towhee import pipe, ops

        >>> p = (
        ...     pipe.input('url')
        ...         .map('url', 'image', ops.image_decode.cv2_rgb())
        ...         .map('image', 'vec', ops.image_embedding.timm(model_name='resnet50'))
        ...         .output('vec')
        ... )

        >>> towhee.build_pipeline_model(
        ...     dc_pipeline=p,
        ...     model_root='models',
        ...     format_priority=['onnx'],
        ...     parallelism=4,
        ...     server='triton'
        ... )
    """

    if server == 'triton':
        dag_repr = copy.deepcopy(dc_pipeline.dag_repr)
        server_conf = {
            constant.FORMAT_PRIORITY: format_priority,
            constant.PARALLELISM: parallelism
        }
        builder = TritonModelBuilder(dag_repr, model_root, server_conf)
    else:
        engine_log.error('Unknown server type: %s.', server)
        builder = None

    if builder is not None:
        return builder.build()
    return False
Build the pipeline as a model.

Args:
dc_pipeline ('towhee.RuntimePipeline'):
The piepline to build as a model.
model_root (`str`):
The model root path.
format_priority (`list`):
The priority order of the model format.
parallelism (`int`):
The parallel number.
server (`str`):
The server type.

Examples:
>>> import towhee
>>> from towhee import pipe, ops

>>> p = (
...     pipe.input('url')
...         .map('url', 'image', ops.image_decode.cv2_rgb())
...         .map('image', 'vec', ops.image_embedding.timm(model_name='resnet50'))
...         .output('vec')
... )

>>> towhee.build_pipeline_model(
...     dc_pipeline=p,
...     model_root='models',
...     format_priority=['onnx'],
...     parallelism=4,
...     server='triton'
... )
towhee/serve/server_builder.py