Buckets:
| # pipelines | |
| Pipelines provide a high-level, easy to use, API for running machine learning models. | |
| **Example:** Instantiate pipeline using the `pipeline` function. | |
| ```javascript | |
| import { pipeline } from '@huggingface/transformers'; | |
| const classifier = await pipeline('sentiment-analysis'); | |
| const output = await classifier('I love transformers!'); | |
| // [{'label': 'POSITIVE', 'score': 0.999817686}] | |
| ``` | |
| * [pipelines](#module_pipelines) | |
| * _static_ | |
| * [`.pipeline(task, [model], [options])`](#module_pipelines.pipeline) ⇒ Promise.<AllTasks> | |
| * _inner_ | |
| * [`~AllTasks`](#module_pipelines..AllTasks) : string | |
| * * * | |
| ## `pipelines.pipeline(task, [model], [options])` ⇒ Promise.<AllTasks> | |
| Utility factory method to build a `Pipeline` object. | |
| **Kind**: static method of [pipelines](#module_pipelines) | |
| **Returns**: Promise.<AllTasks> - A Pipeline object for the specified task. | |
| **Throws**: | |
| - Error If an unsupported pipeline is requested. | |
| ParamTypeDefaultDescription | |
| taskTThe task defining which pipeline will be returned. Currently accepted tasks are: | |
| "audio-classification": will return a AudioClassificationPipeline. | |
| "automatic-speech-recognition": will return a AutomaticSpeechRecognitionPipeline. | |
| "depth-estimation": will return a DepthEstimationPipeline. | |
| "document-question-answering": will return a DocumentQuestionAnsweringPipeline. | |
| "feature-extraction": will return a FeatureExtractionPipeline. | |
| "fill-mask": will return a FillMaskPipeline. | |
| "image-classification": will return a ImageClassificationPipeline. | |
| "image-segmentation": will return a ImageSegmentationPipeline. | |
| "image-to-text": will return a ImageToTextPipeline. | |
| "object-detection": will return a ObjectDetectionPipeline. | |
| "question-answering": will return a QuestionAnsweringPipeline. | |
| "summarization": will return a SummarizationPipeline. | |
| "text2text-generation": will return a Text2TextGenerationPipeline. | |
| "text-classification" (alias "sentiment-analysis" available): will return a TextClassificationPipeline. | |
| "text-generation": will return a TextGenerationPipeline. | |
| "token-classification" (alias "ner" available): will return a TokenClassificationPipeline. | |
| "translation": will return a TranslationPipeline. | |
| "translation_xx_to_yy": will return a TranslationPipeline. | |
| "zero-shot-classification": will return a ZeroShotClassificationPipeline. | |
| "zero-shot-audio-classification": will return a ZeroShotAudioClassificationPipeline. | |
| "zero-shot-image-classification": will return a ZeroShotImageClassificationPipeline. | |
| "zero-shot-object-detection": will return a ZeroShotObjectDetectionPipeline. | |
| [model]stringnullThe name of the pre-trained model to use. If not specified, the default model for the task will be used. | |
| [options]PretrainedModelOptionsOptional parameters for the pipeline. | |
| * * * | |
| ## `pipelines~AllTasks` : string | |
| All possible pipeline types. | |
| **Kind**: inner typedef of [pipelines](#module_pipelines) | |
| * * * | |
Xet Storage Details
- Size:
- 3.23 kB
- Xet hash:
- 50190290bbaf7ce767c51d607f196e11edaf139cb41a626619115a69af3a7d79
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.