diff --git a/src/transformers/pipelines/audio_classification.py b/src/transformers/pipelines/audio_classification.py index a71481567e..045997961f 100644 --- a/src/transformers/pipelines/audio_classification.py +++ b/src/transformers/pipelines/audio_classification.py @@ -77,16 +77,11 @@ class AudioClassificationPipeline(Pipeline): >>> from transformers import pipeline >>> classifier = pipeline(model="superb/wav2vec2-base-superb-ks") - >>> result = classifier("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/1.flac") - - >>> # Simplify results, different torch versions might alter the scores slightly. - >>> from transformers.testing_utils import nested_simplify - - >>> nested_simplify(result) + >>> classifier("https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/1.flac") [{'score': 0.997, 'label': '_unknown_'}, {'score': 0.002, 'label': 'left'}, {'score': 0.0, 'label': 'yes'}, {'score': 0.0, 'label': 'down'}, {'score': 0.0, 'label': 'stop'}] ``` - [Using pipelines in a webserver or with a dataset](../pipeline_tutorial) + [Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial) This pipeline can currently be loaded from [`pipeline`] using the following task identifier: diff --git a/src/transformers/pipelines/automatic_speech_recognition.py b/src/transformers/pipelines/automatic_speech_recognition.py index a702b30681..5569be33c9 100644 --- a/src/transformers/pipelines/automatic_speech_recognition.py +++ b/src/transformers/pipelines/automatic_speech_recognition.py @@ -118,7 +118,7 @@ class AutomaticSpeechRecognitionPipeline(ChunkPipeline): {'text': ' He hoped there would be stew for dinner, turnips and carrots and bruised potatoes and fat mutton pieces to be ladled out in thick, peppered flour fat and sauce.'} ``` - [Using pipelines in a webserver or with a dataset](../pipeline_tutorial) + [Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial) Arguments: model ([`PreTrainedModel`] or [`TFPreTrainedModel`]): diff --git a/src/transformers/pipelines/conversational.py b/src/transformers/pipelines/conversational.py index e4e4587fda..950b87bf9a 100644 --- a/src/transformers/pipelines/conversational.py +++ b/src/transformers/pipelines/conversational.py @@ -181,7 +181,7 @@ class ConversationalPipeline(Pipeline): "It's a comedy." ``` - [Using pipelines in a webserver or with a dataset](../pipeline_tutorial) + [Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial) This conversational pipeline can currently be loaded from [`pipeline`] using the following task identifier: `"conversational"`. diff --git a/src/transformers/pipelines/depth_estimation.py b/src/transformers/pipelines/depth_estimation.py index a3710b0d61..d53c81bdf0 100644 --- a/src/transformers/pipelines/depth_estimation.py +++ b/src/transformers/pipelines/depth_estimation.py @@ -36,7 +36,7 @@ class DepthEstimationPipeline(Pipeline): torch.Size([1, 384, 384]) ``` - [Using pipelines in a webserver or with a dataset](../pipeline_tutorial) + [Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial) This depth estimation pipeline can currently be loaded from [`pipeline`] using the following task identifier: diff --git a/src/transformers/pipelines/document_question_answering.py b/src/transformers/pipelines/document_question_answering.py index 5362c578c3..860702e08d 100644 --- a/src/transformers/pipelines/document_question_answering.py +++ b/src/transformers/pipelines/document_question_answering.py @@ -120,7 +120,7 @@ class DocumentQuestionAnsweringPipeline(ChunkPipeline): '1110212019' ``` - [Using pipelines in a webserver or with a dataset](../pipeline_tutorial) + [Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial) This document question answering pipeline can currently be loaded from [`pipeline`] using the following task identifier: `"document-question-answering"`. diff --git a/src/transformers/pipelines/feature_extraction.py b/src/transformers/pipelines/feature_extraction.py index f46ccfb511..e05e55621d 100644 --- a/src/transformers/pipelines/feature_extraction.py +++ b/src/transformers/pipelines/feature_extraction.py @@ -20,7 +20,7 @@ class FeatureExtractionPipeline(Pipeline): torch.Size([1, 8, 768]) ``` - [Using pipelines in a webserver or with a dataset](../pipeline_tutorial) + [Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial) This feature extraction pipeline can currently be loaded from [`pipeline`] using the task identifier: `"feature-extraction"`. diff --git a/src/transformers/pipelines/fill_mask.py b/src/transformers/pipelines/fill_mask.py index dcb8bbfea0..6f460494f5 100644 --- a/src/transformers/pipelines/fill_mask.py +++ b/src/transformers/pipelines/fill_mask.py @@ -42,15 +42,11 @@ class FillMaskPipeline(Pipeline): >>> from transformers import pipeline >>> fill_masker = pipeline(model="bert-base-uncased") - >>> potential_words = fill_masker("This is a simple [MASK].") - - >>> from transformers.testing_utils import nested_simplify - - >>> nested_simplify(potential_words) # The scores might vary slightly across pytorch/tensorflow versions. + >>> fill_masker("This is a simple [MASK].") [{'score': 0.042, 'token': 3291, 'token_str': 'problem', 'sequence': 'this is a simple problem.'}, {'score': 0.031, 'token': 3160, 'token_str': 'question', 'sequence': 'this is a simple question.'}, {'score': 0.03, 'token': 8522, 'token_str': 'equation', 'sequence': 'this is a simple equation.'}, {'score': 0.027, 'token': 2028, 'token_str': 'one', 'sequence': 'this is a simple one.'}, {'score': 0.024, 'token': 3627, 'token_str': 'rule', 'sequence': 'this is a simple rule.'}] ``` - [Using pipelines in a webserver or with a dataset](../pipeline_tutorial) + [Learn more about the basics of using a pipeline in the [pipeline tutorial]](../pipeline_tutorial) This mask filling pipeline can currently be loaded from [`pipeline`] using the following task identifier: `"fill-mask"`.