← All news

News / AI tools / Image, video & audio

transformers

Transformers is a model-definition framework for state-of-the-art machine learning models in text, computer vision, audio, video, and multimodal tasks. It works for both inference and training. The project is made by Hugging Face and is hosted on GitHub as huggingface/transformers.

Updated 24 Nov 2026 · stars from GitHub

Transformers gives one shared definition for each model, so the same model works across many training frameworks and inference engines. It provides a high-level Pipeline API that handles preprocessing and returns output for tasks such as text generation, speech recognition, image classification, and visual question answering. Over 1 million pretrained checkpoints are available on the Hugging Face Hub.

  1. Create a virtual environment

    python -m venv .my-env
    source .my-env/bin/activate
  2. Install Transformers with PyTorch

    pip install "transformers[torch]"
  3. Run a text generation pipeline

    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 ")

Commands copied from the project's README. Check the official docs for your system.

Use Transformers when you want to run or train a pretrained model with little setup. Do not use it as a toolbox of building blocks for neural networks, because the model code is kept simple on purpose. For generic machine learning training loops, the README suggests Accelerate instead.

Something wrong? Email hello@capylaunch.com. All AI tools