Buckets:
pipelines
Pipelines provide a high-level, easy to use, API for running machine learning models.
Example: Instantiate pipeline using the pipeline function.
import { pipeline } from '@huggingface/transformers';
const classifier = await pipeline('sentiment-analysis');
const output = await classifier('I love transformers!');
// [{'label': 'POSITIVE', 'score': 0.999817686}]
- pipelines
- static
.pipeline(task, [model], [options])⇒ Promise.<AllTasks>~files_loading: FilesLoadingMap~metadata: Array.<{exists: boolean, size: number, contentType: string, fromCache: boolean}>
- inner
~AllTasks: string
- static
pipelines.pipeline(task, [model], [options]) ⇒ Promise.<AllTasks>
Utility factory method to build a Pipeline object.
Kind: static method of pipelines
Returns: Promise.<AllTasks> - A Pipeline object for the specified task.
Throws:
Error If an unsupported pipeline is requested.
ParamTypeDefaultDescriptiontaskTThe task defining which pipeline will be returned. Currently accepted tasks are:
"audio-classification": will return a AudioClassificationPipeline. "automatic-speech-recognition": will return a AutomaticSpeechRecognitionPipeline. "background-removal": will return a BackgroundRemovalPipeline. "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.
.pipeline(task, [model], [options])⇒ Promise.<AllTasks>~files_loading: FilesLoadingMap~metadata: Array.<{exists: boolean, size: number, contentType: string, fromCache: boolean}>
pipeline~files_loading : FilesLoadingMap
Kind: inner property of pipeline
pipeline~metadata : Array.<{exists: boolean, size: number, contentType: string, fromCache: boolean}>
Kind: inner constant of pipeline
pipelines~AllTasks : string
All possible pipeline types.
Kind: inner typedef of pipelines
Xet Storage Details
- Size:
- 4.2 kB
- Xet hash:
- 3b576f0476be3eb9d1237f6e4bdecd8155d09ef2f2336fc03edf54eae1cce156
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.