← AI GitHub

AI GitHub

Transformers for using published model architectures

Load supported pretrained models and connect tokenizers and processors to inference or training code.

AI EducationPublished 2 min read

Key Takeaways

  • Transformers provides model implementations, auto classes and task pipelines.
  • Select the checkpoint and task class, then load the tokenizer or processor specified for that checkpoint.
  • Compare a task pipeline with the corresponding lower-level model call on one input.
  • Review the model card and configuration before enabling remote repository code or relying on a model's output.

How it works

Transformers provides model implementations, auto classes and task pipelines. Each checkpoint can specify architecture, preprocessing and tokenizer details that matter to the calling code.

What you need

Select the checkpoint and task class, then load the tokenizer or processor specified for that checkpoint. Keep the two revisions together when reporting results.

What to try first

Compare a task pipeline with the corresponding lower-level model call on one input. Check how padding, truncation and generation settings affect results.

Load the same tokenizer and model revision on two machines. Save the input IDs so differences in output can be traced to preprocessing or execution settings.

Where to look for failures

Review the model card and configuration before enabling remote repository code or relying on a model's output. Check artifact revisions when reproducing behavior.

Related Franklin pages

Keep the task and input representation fixed as you move between a model library and tensor frameworks. Separate compile or initialization time from subsequent execution.

For the role of multilayer networks and how they learn, see Franklin’s glossary. Deep learning

Project documentation

Try it for your workflow

Explore the project’s documentation for setup and usage, or save this page to a collection for later.

Read the project documentation ↗