Перевірити рівеньКурсиПрограмиДля командТарифи
RUУвійтиРеєстрація
Перевірити рівеньКурсиПрограмиДля командТарифиТест із ClaudeПромптиБлогПитання та відповідіПошукРеєстраціяRU
AcademlКурсиHugging Face LLM Course: Practical TransformersPipeline API: Run Models in Three Lines
Донавчання LoRA: велика матриця ваг і дві вузькі, які до неї додаютьКоманда ollama run і шкала відеопамʼяті, в яку вміщується модельПолиця з відкритими моделями: DeepSeek, Qwen, Mistral, Llama
Курс

Hugging Face LLM Course: Practical Transformers

Модуль 1 · Transformers and Tokenization
01Pipeline API: Run Models in Three Lines02Tokenization: BPE, WordPiece, SentencePiece03Hugging Face Hub: Finding and Downloading Models
Модуль 2 · Fine-Tuning
04Dataset Preparation: load_dataset and Tokenization05Trainer API: Fine-Tuning a Classifier06PEFT and LoRA: Fine-Tuning Without Full Training
Модуль 3 · Advanced Capabilities
07Hugging Face Inference Providers: Serverless Inference08Gradio + Spaces: Deploy an ML Demo in 10 Minutes09vLLM + smolagents: Inference Server and Tool-Using Agents
Hugging Face LLM Course: Practical Transformers · Урок 1

Pipeline API: Run Models in Three Lines

Hugging Face pipeline() lets you run NLP tasks without knowing the model's architecture, and with a chat model it handles generation, summarization and translation in messages format (transformers 5).

ENМатеріали курсів поки англійською. Інтерфейс, ШІ-наставник і перевірка завдань — українською.

35 хв читанняОновлено 23.11.20262 питання у квізіГотовий промпт включено

What is pipeline

pipeline() handles model selection, tokenization, and post-processing automatically. The examples below target transformers 5 (5.24.0 is current as of November 21, 2026). Version 5 is PyTorch-only and needs Python 3.11 or newer: pip install -U transformers torch.

from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
import torch

clf = pipeline("sentiment-analysis")
print(clf("This library is amazing!"))  # [{'label': 'POSITIVE', 'score': 0.9998}]
print(clf("This library is amazing!", top_k=None))  # probabilities for every class

model_name = "distilbert/distilbert-base-uncased-finetuned-sst-2-english"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
inputs = tokenizer("I love transformers!", return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
print(model.config.id2label[logits.argmax(-1).item()])

zs = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
print(zs("Python is a language", candidate_labels=["tech", "sport", "food"]))

Далі урок відкривається після безкоштовної реєстрації

Реєстрація через email або Google відкриває перші два уроки кожного курсу назавжди і 7 днів повного доступу до всього каталогу. Картка не потрібна.

Зареєструватися безкоштовноАбо пробний урок без реєстрації →
У цьому уроці
What is pipelineText Generation: Chat ModelsSummarization, Translation and Question AnsweringSupported TasksПрактикаГотовий промптКвіз
КурсиКурси з LLMДля командТарифиПитання та відповідіБлогПро насКонфіденційність
© 2026 AcademlРозробка та просування сайтів —MMIX — Marketing Mix
Почати безкоштовно