Heuristic:Microsoft LoRA Warning Deprecated Legacy Examples
| Knowledge Sources | |
|---|---|
| Domains | NLP, Deprecation |
| Last Updated | 2026-02-10 06:00 GMT |
Overview
Deprecation warning for HuggingFace Transformers example scripts in the legacy/ directory, which are not actively maintained.
Description
The examples/NLU/examples/legacy/ directory contains community-contributed example scripts that are not actively maintained by the repository authors. The legacy README explicitly states: "This folder contains examples which are not actively maintained (mostly contributed by the community)." These scripts may use outdated APIs, deprecated PyTorch Lightning patterns, or obsolete training workflows. Modern replacements exist in the non-legacy example directories.
Usage
Apply this warning when referencing any Implementation page whose source file resides in the examples/NLU/examples/legacy/ directory. Users should prefer the modern equivalents in the non-legacy directories when available.
The Insight (Rule of Thumb)
- Action: Check whether a modern (non-legacy) equivalent exists before using legacy scripts.
- Value: Legacy scripts may reference outdated HF Transformers APIs (pre-v4.x patterns).
- Trade-off: Legacy scripts may still work but are not tested against current library versions and may break without notice.
- Known Issues: `lightning_base.py` contains `# TODO: remove with PyTorch 1.6` markers; `run_ner.py` references deprecated `test_end` PL callback.
Reasoning
The legacy directory was explicitly marked as unmaintained in the repository README. Modern equivalents (e.g., `examples/NLU/examples/token-classification/run_ner.py` replaces `examples/NLU/examples/legacy/token-classification/run_ner.py`) use the current HF Trainer API and are actively tested. Using legacy scripts risks compatibility issues with newer versions of PyTorch, Transformers, and PyTorch Lightning.
Related Pages
- Implementation:Microsoft_LoRA_Legacy_Utils_Multiple_Choice
- Implementation:Microsoft_LoRA_Lightning_Base
- Implementation:Microsoft_LoRA_Legacy_Run_Squad
- Implementation:Microsoft_LoRA_Legacy_Run_Language_Modeling
- Implementation:Microsoft_LoRA_Legacy_Run_OpenAI_GPT
- Implementation:Microsoft_LoRA_Legacy_Run_SWAG
- Implementation:Microsoft_LoRA_Run_Chinese_Ref
- Implementation:Microsoft_LoRA_Legacy_Finetune_Trainer_Seq2Seq
- Implementation:Microsoft_LoRA_Pack_Dataset
- Implementation:Microsoft_LoRA_Run_Distributed_Eval
- Implementation:Microsoft_LoRA_Seq2Seq_Trainer
- Implementation:Microsoft_LoRA_Legacy_Seq2Seq_Utils
- Implementation:Microsoft_LoRA_Legacy_Run_NER