"tests/models/biogpt/test_tokenization_biogpt.py" did not exist on "1484d67de9f4c8301874d62d821bbfbd3d6ce99b"
Unverified Commit 1d489b3e authored by amyeroberts's avatar amyeroberts Committed by GitHub
Browse files

Task-specific pipeline init args (#28439)

* Abstract out pipeline init args

* Address PR comments

* Reword

* BC PIPELINE_INIT_ARGS

* Remove old arguments

* Small fix
parent 2fa1c808
from typing import Union
from ..utils import add_end_docstrings, is_torch_available, is_vision_available, logging
from .base import PIPELINE_INIT_ARGS, Pipeline
from .base import Pipeline, build_pipeline_init_args
if is_vision_available():
......@@ -15,7 +15,7 @@ if is_torch_available():
logger = logging.get_logger(__name__)
@add_end_docstrings(PIPELINE_INIT_ARGS)
@add_end_docstrings(build_pipeline_init_args(has_tokenizer=True, has_image_processor=True))
class VisualQuestionAnsweringPipeline(Pipeline):
"""
Visual Question Answering pipeline using a `AutoModelForVisualQuestionAnswering`. This pipeline is currently only
......
......@@ -23,13 +23,13 @@ from ..utils import (
logging,
)
from .audio_classification import ffmpeg_read
from .base import PIPELINE_INIT_ARGS, Pipeline
from .base import Pipeline, build_pipeline_init_args
logger = logging.get_logger(__name__)
@add_end_docstrings(PIPELINE_INIT_ARGS)
@add_end_docstrings(build_pipeline_init_args(has_feature_extractor=True, has_tokenizer=True))
class ZeroShotAudioClassificationPipeline(Pipeline):
"""
Zero shot audio classification pipeline using `ClapModel`. This pipeline predicts the class of an audio when you
......
......@@ -5,7 +5,7 @@ import numpy as np
from ..tokenization_utils import TruncationStrategy
from ..utils import add_end_docstrings, logging
from .base import PIPELINE_INIT_ARGS, ArgumentHandler, ChunkPipeline
from .base import ArgumentHandler, ChunkPipeline, build_pipeline_init_args
logger = logging.get_logger(__name__)
......@@ -43,7 +43,7 @@ class ZeroShotClassificationArgumentHandler(ArgumentHandler):
return sequence_pairs, sequences
@add_end_docstrings(PIPELINE_INIT_ARGS)
@add_end_docstrings(build_pipeline_init_args(has_tokenizer=True))
class ZeroShotClassificationPipeline(ChunkPipeline):
"""
NLI-based zero-shot classification pipeline using a `ModelForSequenceClassification` trained on NLI (natural
......
......@@ -9,7 +9,7 @@ from ..utils import (
logging,
requires_backends,
)
from .base import PIPELINE_INIT_ARGS, Pipeline
from .base import Pipeline, build_pipeline_init_args
if is_vision_available():
......@@ -29,7 +29,7 @@ if is_tf_available():
logger = logging.get_logger(__name__)
@add_end_docstrings(PIPELINE_INIT_ARGS)
@add_end_docstrings(build_pipeline_init_args(has_image_processor=True))
class ZeroShotImageClassificationPipeline(Pipeline):
"""
Zero shot image classification pipeline using `CLIPModel`. This pipeline predicts the class of an image when you
......
from typing import Any, Dict, List, Union
from ..utils import add_end_docstrings, is_torch_available, is_vision_available, logging, requires_backends
from .base import PIPELINE_INIT_ARGS, ChunkPipeline
from .base import ChunkPipeline, build_pipeline_init_args
if is_vision_available():
......@@ -19,7 +19,7 @@ if is_torch_available():
logger = logging.get_logger(__name__)
@add_end_docstrings(PIPELINE_INIT_ARGS)
@add_end_docstrings(build_pipeline_init_args(has_image_processor=True))
class ZeroShotObjectDetectionPipeline(ChunkPipeline):
"""
Zero shot object detection pipeline using `OwlViTForObjectDetection`. This pipeline predicts bounding boxes of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment