Why it matters

Pipelines lower the barrier for using models. Understanding them accelerates experimentation.

Advertisement

The architecture

Create: pipeline(task, model, tokenizer). Task-specific defaults for popular tasks.

Invoke: call with input; returns dict of results.

Pipeline APIPick tasktext-gen / classify / etcLoad modelauto or specifiedCallableinput → resultGreat for prototyping; production apps often bypass pipelines for control
Pipeline usage.
Advertisement

How it works end to end

Supported tasks: text generation, classification, QA, NER, translation, summarization, zero-shot classification, image classification, ASR, TTS.

Batch inference: pass list; pipeline batches automatically.

Device: pipeline(device=0) uses GPU 0.

Custom: PipelineRegistry lets you add tasks.