diff --git a/src/transformers/pipelines/__init__.py b/src/transformers/pipelines/__init__.py index d0d72e55715097..c312cb68c97884 100755 --- a/src/transformers/pipelines/__init__.py +++ b/src/transformers/pipelines/__init__.py @@ -711,6 +711,12 @@ def pipeline( Additional keyword arguments passed along to the specific pipeline init (see the documentation for the corresponding pipeline class for possible values). + Note: + While there are such optional arguments as `tokenizer`, `feature_extractor`, `image_processor`, and `processor`, + they shouldn't be specified all at once. If these components are not provided, `pipeline` will try to load + required ones automatically. In case you want to provide these components explicitly, please refer to a + specific pipeline in order to get more details regarding what components are required. + Returns: [`Pipeline`]: A suitable pipeline for the task. diff --git a/src/transformers/pipelines/base.py b/src/transformers/pipelines/base.py index 1d9afaaf4cbcac..be73d76b57f8d5 100644 --- a/src/transformers/pipelines/base.py +++ b/src/transformers/pipelines/base.py @@ -744,7 +744,8 @@ def build_pipeline_init_args( docstring += r""" processor ([`ProcessorMixin`]): The processor that will be used by the pipeline to encode data for the model. This object inherits from - [`ProcessorMixin`].""" + [`ProcessorMixin`]. Processor is a composite object that might contain `tokenizer`, `feature_extractor`, and + `image_processor`.""" docstring += r""" modelcard (`str` or [`ModelCard`], *optional*): Model card attributed to the model for this pipeline. @@ -798,7 +799,7 @@ def build_pipeline_init_args( ) -@add_end_docstrings(build_pipeline_init_args(has_tokenizer=True, has_feature_extractor=True, has_image_processor=True)) +@add_end_docstrings(build_pipeline_init_args(has_tokenizer=True, has_feature_extractor=True, has_image_processor=True, has_processor=True)) class Pipeline(_ScikitCompat, PushToHubMixin): """ The Pipeline class is the class from which all pipelines inherit. Refer to this class for methods shared across