Pretrain, finetune ANY AI model of ANY size on 1 or 10,000+ GPUs with zero code changes
Opening the entry
Opening the entry
Hugging Face model-definition framework for text, vision, audio and multimodal models, for inference and training.
Transformers centralizes model definitions so they can be shared across training frameworks, inference engines and related libraries. It targets people who want to run or train pretrained models for text, vision, audio, video and multimodal tasks. The Pipeline API gives a high-level way to run inference, and models are downloaded from the Hugging Face Hub and cached. It needs Python 3.11 or later and PyTorch 2.6 or later.
pip install "transformers[torch]" uv pip install "transformers[torch]"
from transformers import pipeline
pipeline = pipeline(task="text-generation", model="Qwen/Qwen2.5-1.5B")
pipeline("the secret to baking a really good cake is ")huggingface/transformers is a third-party open-source project, listed here from public GitHub data. ImuTechz did not write it and has not reviewed or security-audited its code. Read the source and its permissions before you install or run it.