Pipeline API: Run Models in Three Lines
Hugging Face pipeline() lets you run NLP tasks without knowing the model's architecture.
Run three different pipelines (sentiment, ner, summarization) and swap the default model for a more recent Hub model. Benchmark default vs. newer on the same inputs.
Task grader
Copy and adapt to your context. Text in angle brackets should be replaced.
Help me pick a pipeline. Task: <…> Language: <…> GPU available: <yes/no> Suggest a pipeline type and 2-3 Hub models.
Prompt sandbox
- Forgetting device=0 with a GPU — 10x slower on CPU.
- Using the default English model on non-English text without checking language support.