# Migration Context: Hugging Face Transformers v1 -> v2 # Generated by Changelogs.us: 2026-11-30T03:04:30.545281+00:00 # Target Version: v2.11.0 # Upgrade Command: N/A # Breaking Changes: 10 # Security Fixes: 0 ## Executive Summary Upgrading Hugging Face Transformers from 1 to 2 involves 18 releases with risk rating High. ## Breaking Changes List: - [vv2.0.0] Breaking changes ### Positional order of some model keywords inputs changed (better TorchScript support): - [vv2.0.0] If you used to call the models with keyword names for keyword arguments, e.g. `model(inputs_ids, attention_mask=attention_mask, token_type_ids=token_type_ids)`, this should not cause any breaking change.: - [vv2.1.1] Breaking changes - The two methods `add_special_tokens_single_sequence` and `add_special_tokens_sequence_pair` have been removed. They have been replaced by the single method `build_inputs_with_special_tokens ` which has a more comprehensible name and manages both sequence singletons and pairs.: - [vv2.2.0] Breaking changes __Tokenizers now add special tokens by default.__ @LysandreJik: - [vv2.4.0] [BREAKING CHANGES] ## Ignored indices in PyTorch loss computing (@LysandreJik): - [vv2.5.1] AutoTokenizer has been put back to False by default so as to not have a breaking change between 2.4.x and 2.5.x: - [vv2.9.0] Breaking change This introduces a breaking change, in that it increases the default output length of T5Model and T5ForConditionalGeneration from 4 to 5 (including the past_key_value_states).: - [vv2.9.0] This introduces a breaking change, in that it increases the default output length of T5Model and T5ForConditionalGeneration from 4 to 5 (including the past_key_value_states).: - [vv2.11.0] ⚠️ This PR is breaking for the following models: BART, Flaubert, bert-japanese, bert-base-finnish, bert-base-dutch. ⚠️: - [vv2.11.0] Update: ⚠️ This PR is also breaking for ALBERT from Tensorflow. See issue #4806 for discussion and resolution ⚠️: ## Instructions for AI Assistant: When migrating user code from Hugging Face Transformers 1 to 2, scan for the deprecated APIs and breaking changes above and refactor code to use modern vv2.11.0 idioms.