mirror of
				https://github.com/huggingface/transformers.git
				synced 2025-10-26 14:06:45 +08:00 
			
		
		
		
	Compare commits
	
		
			12 Commits
		
	
	
		
			remove_dat
			...
			v4.30.2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 66fd3a8d62 | |||
| 8f9f1efaf8 | |||
| 497d66740b | |||
| 65a1ec05ca | |||
| fd59fc1a7f | |||
| a272e4135c | |||
| 50ed79312d | |||
| fe861e578f | |||
| b3e27a8057 | |||
| 53e1f5cf66 | |||
| 17db177714 | |||
| 905892f090 | 
| @ -292,7 +292,7 @@ Current number of checkpoints: ** (from Google Research) released with the paper [Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision](https://arxiv.org/abs/2102.05918) by Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V. Le, Yunhsuan Sung, Zhen Li, Tom Duerig. | ||||
| 1. **[AltCLIP](https://huggingface.co/docs/transformers/model_doc/altclip)** (from BAAI) released with the paper [AltCLIP: Altering the Language Encoder in CLIP for Extended Language Capabilities](https://arxiv.org/abs/2211.06679) by Chen, Zhongzhi and Liu, Guang and Zhang, Bo-Wen and Ye, Fulong and Yang, Qinghong and Wu, Ledell. | ||||
| 1. **[Audio Spectrogram Transformer](https://huggingface.co/docs/transformers/model_doc/audio-spectrogram-transformer)** (from MIT) released with the paper [AST: Audio Spectrogram Transformer](https://arxiv.org/abs/2104.01778) by Yuan Gong, Yu-An Chung, James Glass. | ||||
| 1. **[Autoformer](https://huggingface.co/docs/transformers/main/model_doc/autoformer)** (from Tsinghua University) released with the paper [Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting](https://arxiv.org/abs/2106.13008) by Haixu Wu, Jiehui Xu, Jianmin Wang, Mingsheng Long. | ||||
| 1. **[Autoformer](https://huggingface.co/docs/transformers/model_doc/autoformer)** (from Tsinghua University) released with the paper [Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting](https://arxiv.org/abs/2106.13008) by Haixu Wu, Jiehui Xu, Jianmin Wang, Mingsheng Long. | ||||
| 1. **[BART](https://huggingface.co/docs/transformers/model_doc/bart)** (from Facebook) released with the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke Zettlemoyer. | ||||
| 1. **[BARThez](https://huggingface.co/docs/transformers/model_doc/barthez)** (from École polytechnique) released with the paper [BARThez: a Skilled Pretrained French Sequence-to-Sequence Model](https://arxiv.org/abs/2010.12321) by Moussa Kamal Eddine, Antoine J.-P. Tixier, Michalis Vazirgiannis. | ||||
| 1. **[BARTpho](https://huggingface.co/docs/transformers/model_doc/bartpho)** (from VinAI Research) released with the paper [BARTpho: Pre-trained Sequence-to-Sequence Models for Vietnamese](https://arxiv.org/abs/2109.09701) by Nguyen Luong Tran, Duong Minh Le and Dat Quoc Nguyen. | ||||
| @ -406,7 +406,7 @@ Current number of checkpoints: ** (from Google Inc.) released with the paper [MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications](https://arxiv.org/abs/1704.04861) by Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam. | ||||
| 1. **[MobileNetV2](https://huggingface.co/docs/transformers/model_doc/mobilenet_v2)** (from Google Inc.) released with the paper [MobileNetV2: Inverted Residuals and Linear Bottlenecks](https://arxiv.org/abs/1801.04381) by Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, Liang-Chieh Chen. | ||||
| 1. **[MobileViT](https://huggingface.co/docs/transformers/model_doc/mobilevit)** (from Apple) released with the paper [MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer](https://arxiv.org/abs/2110.02178) by Sachin Mehta and Mohammad Rastegari. | ||||
| 1. **[MobileViTV2](https://huggingface.co/docs/transformers/main/model_doc/mobilevitv2)** (from Apple) released with the paper [Separable Self-attention for Mobile Vision Transformers](https://arxiv.org/abs/2206.02680) by Sachin Mehta and Mohammad Rastegari. | ||||
| 1. **[MobileViTV2](https://huggingface.co/docs/transformers/model_doc/mobilevitv2)** (from Apple) released with the paper [Separable Self-attention for Mobile Vision Transformers](https://arxiv.org/abs/2206.02680) by Sachin Mehta and Mohammad Rastegari. | ||||
| 1. **[MPNet](https://huggingface.co/docs/transformers/model_doc/mpnet)** (from Microsoft Research) released with the paper [MPNet: Masked and Permuted Pre-training for Language Understanding](https://arxiv.org/abs/2004.09297) by Kaitao Song, Xu Tan, Tao Qin, Jianfeng Lu, Tie-Yan Liu. | ||||
| 1. **[MT5](https://huggingface.co/docs/transformers/model_doc/mt5)** (from Google AI) released with the paper [mT5: A massively multilingual pre-trained text-to-text transformer](https://arxiv.org/abs/2010.11934) by Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, Colin Raffel. | ||||
| 1. **[MVP](https://huggingface.co/docs/transformers/model_doc/mvp)** (from RUC AI Box) released with the paper [MVP: Multi-task Supervised Pre-training for Natural Language Generation](https://arxiv.org/abs/2206.12131) by Tianyi Tang, Junyi Li, Wayne Xin Zhao and Ji-Rong Wen. | ||||
| @ -448,7 +448,7 @@ Current number of checkpoints: ** (from Facebook), released together with the paper [Large-Scale Self- and Semi-Supervised Learning for Speech Translation](https://arxiv.org/abs/2104.06678) by Changhan Wang, Anne Wu, Juan Pino, Alexei Baevski, Michael Auli, Alexis Conneau. | ||||
| 1. **[Splinter](https://huggingface.co/docs/transformers/model_doc/splinter)** (from Tel Aviv University), released together with the paper [Few-Shot Question Answering by Pretraining Span Selection](https://arxiv.org/abs/2101.00438) by Ori Ram, Yuval Kirstain, Jonathan Berant, Amir Globerson, Omer Levy. | ||||
| 1. **[SqueezeBERT](https://huggingface.co/docs/transformers/model_doc/squeezebert)** (from Berkeley) released with the paper [SqueezeBERT: What can computer vision teach NLP about efficient neural networks?](https://arxiv.org/abs/2006.11316) by Forrest N. Iandola, Albert E. Shaw, Ravi Krishna, and Kurt W. Keutzer. | ||||
| 1. **[SwiftFormer](https://huggingface.co/docs/transformers/main/model_doc/swiftformer)** (from MBZUAI) released with the paper [SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications](https://arxiv.org/abs/2303.15446) by Abdelrahman Shaker, Muhammad Maaz, Hanoona Rasheed, Salman Khan, Ming-Hsuan Yang, Fahad Shahbaz Khan. | ||||
| 1. **[SwiftFormer](https://huggingface.co/docs/transformers/model_doc/swiftformer)** (from MBZUAI) released with the paper [SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications](https://arxiv.org/abs/2303.15446) by Abdelrahman Shaker, Muhammad Maaz, Hanoona Rasheed, Salman Khan, Ming-Hsuan Yang, Fahad Shahbaz Khan. | ||||
| 1. **[Swin Transformer](https://huggingface.co/docs/transformers/model_doc/swin)** (from Microsoft) released with the paper [Swin Transformer: Hierarchical Vision Transformer using Shifted Windows](https://arxiv.org/abs/2103.14030) by Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, Baining Guo. | ||||
| 1. **[Swin Transformer V2](https://huggingface.co/docs/transformers/model_doc/swinv2)** (from Microsoft) released with the paper [Swin Transformer V2: Scaling Up Capacity and Resolution](https://arxiv.org/abs/2111.09883) by Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, Furu Wei, Baining Guo. | ||||
| 1. **[Swin2SR](https://huggingface.co/docs/transformers/model_doc/swin2sr)** (from University of Würzburg) released with the paper [Swin2SR: SwinV2 Transformer for Compressed Image Super-Resolution and Restoration](https://arxiv.org/abs/2209.11345) by Marcos V. Conde, Ui-Jin Choi, Maxime Burchi, Radu Timofte. | ||||
|  | ||||
| @ -61,7 +61,7 @@ from transformers.utils import check_min_version, get_full_repo_name, send_examp | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| Array = Any | ||||
| Dataset = datasets.arrow_dataset.Dataset | ||||
|  | ||||
| @ -54,7 +54,7 @@ from transformers.utils import check_min_version, get_full_repo_name, send_examp | ||||
|  | ||||
| logger = logging.getLogger(__name__) | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| Array = Any | ||||
| Dataset = datasets.arrow_dataset.Dataset | ||||
|  | ||||
| @ -55,7 +55,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
| logger = logging.getLogger(__name__) | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/token-classification/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -45,7 +45,7 @@ from transformers.utils.versions import require_version | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.14.0", "To fix: pip install -r examples/pytorch/audio-classification/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -54,7 +54,7 @@ from transformers.utils.versions import require_version | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/contrastive-image-text/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -55,7 +55,7 @@ from transformers.utils.versions import require_version | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/image-classification/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -47,7 +47,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
|  | ||||
|  | ||||
| @ -43,7 +43,7 @@ from transformers.utils.versions import require_version | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/image-pretraining/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -48,7 +48,7 @@ Any model supported by the AutoModelForMaskedImageModeling API can be used. | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/image-pretraining/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -53,7 +53,7 @@ Any model supported by the AutoModelForMaskedImageModeling API can be used. | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/image-pretraining/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -55,7 +55,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -57,7 +57,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
|  | ||||
|  | ||||
| @ -53,7 +53,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -57,7 +57,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt") | ||||
|  | ||||
| @ -47,7 +47,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/language-modeling/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -47,7 +47,7 @@ from transformers.utils import PaddingStrategy, check_min_version, send_example_ | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
|  | ||||
| @ -56,7 +56,7 @@ from transformers.utils import PaddingStrategy, check_min_version, get_full_repo | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
| # You should update this to your particular problem to have better documentation of `model_type` | ||||
|  | ||||
| @ -49,7 +49,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/question-answering/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -48,7 +48,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/question-answering/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -56,7 +56,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/question-answering/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -57,7 +57,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/question-answering/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -46,7 +46,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/question-answering/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -51,7 +51,7 @@ from transformers.utils.versions import require_version | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=2.0.0", "To fix: pip install -r examples/pytorch/semantic-segmentation/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
|  | ||||
|  | ||||
| @ -51,7 +51,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.18.0", "To fix: pip install -r examples/pytorch/speech-recognition/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -48,7 +48,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.18.0", "To fix: pip install -r examples/pytorch/speech-recognition/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -52,7 +52,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/summarization/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -56,7 +56,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/summarization/requirements.txt") | ||||
|  | ||||
| @ -48,7 +48,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/text-classification/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -48,7 +48,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
|  | ||||
|  | ||||
| @ -48,7 +48,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/text-classification/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -49,7 +49,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/token-classification/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -55,7 +55,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/token-classification/requirements.txt") | ||||
|  | ||||
| @ -52,7 +52,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/translation/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -57,7 +57,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = get_logger(__name__) | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/translation/requirements.txt") | ||||
|  | ||||
| @ -51,7 +51,7 @@ from transformers.utils.versions import require_version | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version( | ||||
|     "datasets>=1.8.0", "To fix: pip install -r examples/tensorflow/contrastive-image-text/requirements.txt" | ||||
|  | ||||
| @ -54,7 +54,7 @@ from transformers.utils.versions import require_version | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/image-classification/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ from transformers.utils import PaddingStrategy, check_min_version, send_example_ | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
|  | ||||
| @ -48,7 +48,7 @@ from transformers.utils import CONFIG_NAME, TF2_WEIGHTS_NAME, check_min_version, | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
|  | ||||
| @ -53,7 +53,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
| # region Checking dependencies | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/summarization/requirements.txt") | ||||
|  | ||||
|  | ||||
| @ -47,7 +47,7 @@ from transformers.utils import check_min_version, send_example_telemetry | ||||
|  | ||||
|  | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| task_to_keys = { | ||||
|     "cola": ("sentence", None), | ||||
|  | ||||
| @ -56,7 +56,7 @@ from transformers.utils.versions import require_version | ||||
|  | ||||
| # region Dependencies and constants | ||||
| # Will error if the minimal version of Transformers is not installed. Remove at your own risks. | ||||
| check_min_version("4.30.0.dev0") | ||||
| check_min_version("4.30.0") | ||||
|  | ||||
| require_version("datasets>=1.8.0", "To fix: pip install -r examples/pytorch/summarization/requirements.txt") | ||||
|  | ||||
|  | ||||
							
								
								
									
										4
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								setup.py
									
									
									
									
									
								
							| @ -98,7 +98,7 @@ if stale_egg_info.exists(): | ||||
| # 2. once modified, run: `make deps_table_update` to update src/transformers/dependency_versions_table.py | ||||
| _deps = [ | ||||
|     "Pillow", | ||||
|     "accelerate>=0.20.1", | ||||
|     "accelerate>=0.20.2", | ||||
|     "av==9.2.0",  # Latest version of PyAV (10.0.0) has issues with audio stream. | ||||
|     "beautifulsoup4", | ||||
|     "black~=23.1", | ||||
| @ -428,7 +428,7 @@ install_requires = [ | ||||
|  | ||||
| setup( | ||||
|     name="transformers", | ||||
|     version="4.30.0.dev0",  # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots) | ||||
|     version="4.30.2",  # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots) | ||||
|     author="The Hugging Face team (past and future) with the help of all our contributors (https://github.com/huggingface/transformers/graphs/contributors)", | ||||
|     author_email="transformers@huggingface.co", | ||||
|     description="State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow", | ||||
|  | ||||
| @ -18,7 +18,7 @@ | ||||
| # to defer the actual importing for when the objects are requested. This way `import transformers` provides the names | ||||
| # in the namespace without actually importing anything (and especially none of the backends). | ||||
|  | ||||
| __version__ = "4.30.0.dev0" | ||||
| __version__ = "4.30.2" | ||||
|  | ||||
| from typing import TYPE_CHECKING | ||||
|  | ||||
|  | ||||
| @ -784,6 +784,13 @@ class PretrainedConfig(PushToHubMixin): | ||||
|             ): | ||||
|                 serializable_config_dict[key] = value | ||||
|  | ||||
|         if hasattr(self, "quantization_config"): | ||||
|             serializable_config_dict["quantization_config"] = ( | ||||
|                 self.quantization_config.to_dict() | ||||
|                 if not isinstance(self.quantization_config, dict) | ||||
|                 else self.quantization_config | ||||
|             ) | ||||
|  | ||||
|         self.dict_torch_dtype_to_str(serializable_config_dict) | ||||
|  | ||||
|         return serializable_config_dict | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
| # 2. run `make deps_table_update`` | ||||
| deps = { | ||||
|     "Pillow": "Pillow", | ||||
|     "accelerate": "accelerate>=0.20.1", | ||||
|     "accelerate": "accelerate>=0.20.2", | ||||
|     "av": "av==9.2.0", | ||||
|     "beautifulsoup4": "beautifulsoup4", | ||||
|     "black": "black~=23.1", | ||||
|  | ||||
| @ -81,7 +81,7 @@ elif parse(tf.__version__).minor >= 11: | ||||
|     from keras.engine.keras_tensor import KerasTensor | ||||
| else: | ||||
|     from tensorflow.python.keras import backend as K | ||||
|     from tensorflow.python.keras.engine import call_context | ||||
|     from tensorflow.python.keras.engine.base_layer_utils import call_context | ||||
|     from tensorflow.python.keras.engine.keras_tensor import KerasTensor | ||||
|  | ||||
|  | ||||
| @ -1156,8 +1156,8 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin, TFGenerationMixin, Pu | ||||
|         if self.built or call_context().in_call: | ||||
|             self.built = True | ||||
|         else: | ||||
|             self(self.dummy_inputs, training=False) | ||||
|             self.built = True | ||||
|             self(self.dummy_inputs, training=False) | ||||
|  | ||||
|     def __init__(self, config, *inputs, **kwargs): | ||||
|         super().__init__(*inputs, **kwargs) | ||||
|  | ||||
| @ -668,7 +668,8 @@ DEPARALLELIZE_DOCSTRING = r""" | ||||
|     GPT2_START_DOCSTRING, | ||||
| ) | ||||
| class GPT2Model(GPT2PreTrainedModel): | ||||
|     _keys_to_ignore_on_load_missing = ["attn.masked_bias"] | ||||
|     _keys_to_ignore_on_load_unexpected = [r"h\.\d+\.attn\.bias", r"h\.\d+\.attn\.masked_bias"] | ||||
|     _keys_to_ignore_on_load_missing = [r"attn.masked_bias", r"h\.\d+\.attn\.masked_bias", r"h\.\d+\.attn\.bias"] | ||||
|  | ||||
|     def __init__(self, config): | ||||
|         super().__init__(config) | ||||
| @ -1149,6 +1150,7 @@ input sequence). | ||||
|     GPT2_START_DOCSTRING, | ||||
| ) | ||||
| class GPT2DoubleHeadsModel(GPT2PreTrainedModel): | ||||
|     _keys_to_ignore_on_load_unexpected = [r"h\.\d+\.attn\.bias", r"h\.\d+\.attn\.masked_bias"] | ||||
|     _keys_to_ignore_on_load_missing = [r"attn.masked_bias", r"attn.bias", r"lm_head.weight"] | ||||
|  | ||||
|     def __init__(self, config): | ||||
| @ -1377,6 +1379,7 @@ class GPT2DoubleHeadsModel(GPT2PreTrainedModel): | ||||
|     GPT2_START_DOCSTRING, | ||||
| ) | ||||
| class GPT2ForSequenceClassification(GPT2PreTrainedModel): | ||||
|     _keys_to_ignore_on_load_unexpected = [r"h\.\d+\.attn\.bias", r"h\.\d+\.attn\.masked_bias"] | ||||
|     _keys_to_ignore_on_load_missing = [r"h\.\d+\.attn\.masked_bias", r"lm_head.weight"] | ||||
|  | ||||
|     def __init__(self, config): | ||||
| @ -1600,6 +1603,7 @@ class GPT2ForTokenClassification(GPT2PreTrainedModel): | ||||
|     GPT2_START_DOCSTRING, | ||||
| ) | ||||
| class GPT2ForQuestionAnswering(GPT2PreTrainedModel): | ||||
|     _keys_to_ignore_on_load_unexpected = [r"h\.\d+\.attn\.bias", r"h\.\d+\.attn\.masked_bias"] | ||||
|     _keys_to_ignore_on_load_missing = [r"h\.\d+\.attn\.masked_bias", r"h\.\d+\.attn\.bias", r"lm_head.weight"] | ||||
|  | ||||
|     def __init__(self, config): | ||||
|  | ||||
| @ -1339,6 +1339,11 @@ class TestCasePlus(unittest.TestCase): | ||||
|             AcceleratorState._reset_state() | ||||
|             PartialState._reset_state() | ||||
|  | ||||
|             # delete all the env variables having `ACCELERATE` in them | ||||
|             for k in list(os.environ.keys()): | ||||
|                 if "ACCELERATE" in k: | ||||
|                     del os.environ[k] | ||||
|  | ||||
|  | ||||
| def mockenv(**kwargs): | ||||
|     """ | ||||
|  | ||||
| @ -134,6 +134,8 @@ from .trainer_utils import ( | ||||
| ) | ||||
| from .training_args import OptimizerNames, ParallelMode, TrainingArguments | ||||
| from .utils import ( | ||||
|     ADAPTER_SAFE_WEIGHTS_NAME, | ||||
|     ADAPTER_WEIGHTS_NAME, | ||||
|     CONFIG_NAME, | ||||
|     SAFE_WEIGHTS_INDEX_NAME, | ||||
|     SAFE_WEIGHTS_NAME, | ||||
| @ -1747,7 +1749,16 @@ class Trainer: | ||||
|  | ||||
|         # prepare using `accelerator` prepare | ||||
|         if use_accelerator_prepare: | ||||
|             if hasattr(self.lr_scheduler, "step"): | ||||
|                 if self.use_apex: | ||||
|                     model = self.accelerator.prepare(self.model) | ||||
|                 else: | ||||
|                     model, self.optimizer = self.accelerator.prepare(self.model, self.optimizer) | ||||
|             else: | ||||
|                 # to handle cases wherein we pass "DummyScheduler" such as when it is specified in DeepSpeed config. | ||||
|                 model, self.optimizer, self.lr_scheduler = self.accelerator.prepare( | ||||
|                     self.model, self.optimizer, self.lr_scheduler | ||||
|                 ) | ||||
|  | ||||
|         if self.is_fsdp_enabled: | ||||
|             self.model = model | ||||
| @ -2177,11 +2188,20 @@ class Trainer: | ||||
|         logger.info(f"Loading best model from {self.state.best_model_checkpoint} (score: {self.state.best_metric}).") | ||||
|         best_model_path = os.path.join(self.state.best_model_checkpoint, WEIGHTS_NAME) | ||||
|         best_safe_model_path = os.path.join(self.state.best_model_checkpoint, SAFE_WEIGHTS_NAME) | ||||
|         best_adapter_model_path = os.path.join(self.state.best_model_checkpoint, ADAPTER_WEIGHTS_NAME) | ||||
|         best_safe_adapter_model_path = os.path.join(self.state.best_model_checkpoint, ADAPTER_SAFE_WEIGHTS_NAME) | ||||
|  | ||||
|         model = self.model_wrapped if is_sagemaker_mp_enabled() else self.model | ||||
|         if os.path.exists(best_model_path) or os.path.exists(best_safe_model_path): | ||||
|         if ( | ||||
|             os.path.exists(best_model_path) | ||||
|             or os.path.exists(best_safe_model_path) | ||||
|             or os.path.exists(best_adapter_model_path) | ||||
|             or os.path.exists(best_safe_adapter_model_path) | ||||
|         ): | ||||
|             if self.is_deepspeed_enabled: | ||||
|                 deepspeed_load_checkpoint(self.model_wrapped, self.state.best_model_checkpoint) | ||||
|             else: | ||||
|                 has_been_loaded = True | ||||
|                 if is_sagemaker_mp_enabled(): | ||||
|                     if os.path.isfile(os.path.join(self.state.best_model_checkpoint, "user_content.pt")): | ||||
|                         # If the 'user_content.pt' file exists, load with the new smp api. | ||||
| @ -2207,10 +2227,10 @@ class Trainer: | ||||
|                         self.accelerator, model, self.state.best_model_checkpoint | ||||
|                     ) | ||||
|                 else: | ||||
|                     if hasattr(model, "base_model") and getattr(model.base_model, "is_8bit_serializable", False): | ||||
|                         # If train base_8_bit_models using PEFT & LoRA, assume that adapter have been saved properly. | ||||
|                     if is_peft_available() and isinstance(model, PeftModel): | ||||
|                         # If train a model using PEFT & LoRA, assume that adapter have been saved properly. | ||||
|                         if hasattr(model, "active_adapter") and hasattr(model, "load_adapter"): | ||||
|                             if os.path.exists(os.path.join(self.state.best_model_checkpoint, "adapter_model.bin")): | ||||
|                             if os.path.exists(best_adapter_model_path) or os.path.exists(best_safe_adapter_model_path): | ||||
|                                 model.load_adapter(self.state.best_model_checkpoint, model.active_adapter) | ||||
|                                 # Load_adapter has no return value present, modify it when appropriate. | ||||
|                                 from torch.nn.modules.module import _IncompatibleKeys | ||||
| @ -2219,12 +2239,13 @@ class Trainer: | ||||
|                             else: | ||||
|                                 logger.warning( | ||||
|                                     "The intermediate checkpoints of PEFT may not be saved correctly, " | ||||
|                                     "using `TrainerCallback` to save adapter_model.bin in corresponding folders, " | ||||
|                                     f"using `TrainerCallback` to save {ADAPTER_WEIGHTS_NAME} in corresponding folders, " | ||||
|                                     "here are some examples https://github.com/huggingface/peft/issues/96" | ||||
|                                 ) | ||||
|                                 has_been_loaded = False | ||||
|                         else: | ||||
|                             # We can't do pure 8bit training using transformers. | ||||
|                             logger.warning("Could not loading a quantized checkpoint.") | ||||
|                             logger.warning("Could not load adapter model, make sure to have `peft>=0.3.0` installed") | ||||
|                             has_been_loaded = False | ||||
|                     else: | ||||
|                         # We load the model state dict on the CPU to avoid an OOM error. | ||||
|                         if self.args.save_safetensors and os.path.isfile(best_safe_model_path): | ||||
| @ -2236,7 +2257,7 @@ class Trainer: | ||||
|                         # workaround for FSDP bug https://github.com/pytorch/pytorch/issues/82963 | ||||
|                         # which takes *args instead of **kwargs | ||||
|                         load_result = model.load_state_dict(state_dict, False) | ||||
|                 if not is_sagemaker_mp_enabled(): | ||||
|                 if not is_sagemaker_mp_enabled() and has_been_loaded: | ||||
|                     self._issue_warnings_after_load(load_result) | ||||
|         elif os.path.exists(os.path.join(self.state.best_model_checkpoint, WEIGHTS_INDEX_NAME)): | ||||
|             load_result = load_sharded_checkpoint( | ||||
| @ -2829,6 +2850,7 @@ class Trainer: | ||||
|             or self.is_fsdp_enabled | ||||
|         ): | ||||
|             if self.is_fsdp_enabled: | ||||
|                 os.makedirs(output_dir, exist_ok=True) | ||||
|                 self.accelerator.state.fsdp_plugin.save_model(self.accelerator, self.model, output_dir) | ||||
|             else: | ||||
|                 state_dict = self.model.state_dict() | ||||
|  | ||||
| @ -177,6 +177,8 @@ from .import_utils import ( | ||||
|  | ||||
| WEIGHTS_NAME = "pytorch_model.bin" | ||||
| WEIGHTS_INDEX_NAME = "pytorch_model.bin.index.json" | ||||
| ADAPTER_WEIGHTS_NAME = "adapter_model.bin" | ||||
| ADAPTER_SAFE_WEIGHTS_NAME = "adapter_model.safetensors" | ||||
| TF2_WEIGHTS_NAME = "tf_model.h5" | ||||
| TF2_WEIGHTS_INDEX_NAME = "tf_model.h5.index.json" | ||||
| TF_WEIGHTS_NAME = "model.ckpt" | ||||
|  | ||||
| @ -712,7 +712,6 @@ class PushToHubMixin: | ||||
|         operations = [] | ||||
|         # upload standalone files | ||||
|         for file in modified_files: | ||||
|             operations.append(CommitOperationAdd(path_or_fileobj=os.path.join(working_dir, file), path_in_repo=file)) | ||||
|             if os.path.isdir(os.path.join(working_dir, file)): | ||||
|                 # go over individual files of folder | ||||
|                 for f in os.listdir(os.path.join(working_dir, file)): | ||||
|  | ||||
| @ -146,7 +146,9 @@ if FORCE_TF_AVAILABLE in ENV_VARS_TRUE_VALUES: | ||||
|     _tf_available = True | ||||
| else: | ||||
|     if USE_TF in ENV_VARS_TRUE_AND_AUTO_VALUES and USE_TORCH not in ENV_VARS_TRUE_VALUES: | ||||
|         _tf_available = _is_package_available("tensorflow") | ||||
|         # Note: _is_package_available("tensorflow") fails for tensorflow-cpu. Please test any changes to the line below | ||||
|         # with tensorflow-cpu to make sure it still works! | ||||
|         _tf_available = importlib.util.find_spec("tensorflow") is not None | ||||
|         if _tf_available: | ||||
|             candidates = ( | ||||
|                 "tensorflow", | ||||
|  | ||||
| @ -111,6 +111,19 @@ class Bnb4BitTest(Base4bitTest): | ||||
|         gc.collect() | ||||
|         torch.cuda.empty_cache() | ||||
|  | ||||
|     def test_quantization_config_json_serialization(self): | ||||
|         r""" | ||||
|         A simple test to check if the quantization config is correctly serialized and deserialized | ||||
|         """ | ||||
|         config = self.model_4bit.config | ||||
|  | ||||
|         self.assertTrue(hasattr(config, "quantization_config")) | ||||
|  | ||||
|         _ = config.to_dict() | ||||
|         _ = config.to_diff_dict() | ||||
|  | ||||
|         _ = config.to_json_string() | ||||
|  | ||||
|     def test_memory_footprint(self): | ||||
|         r""" | ||||
|         A simple test to check if the model conversion has been done correctly by checking on the | ||||
|  | ||||
| @ -118,6 +118,19 @@ class MixedInt8Test(BaseMixedInt8Test): | ||||
|         gc.collect() | ||||
|         torch.cuda.empty_cache() | ||||
|  | ||||
|     def test_quantization_config_json_serialization(self): | ||||
|         r""" | ||||
|         A simple test to check if the quantization config is correctly serialized and deserialized | ||||
|         """ | ||||
|         config = self.model_8bit.config | ||||
|  | ||||
|         self.assertTrue(hasattr(config, "quantization_config")) | ||||
|  | ||||
|         _ = config.to_dict() | ||||
|         _ = config.to_diff_dict() | ||||
|  | ||||
|         _ = config.to_json_string() | ||||
|  | ||||
|     def test_memory_footprint(self): | ||||
|         r""" | ||||
|         A simple test to check if the model conversion has been done correctly by checking on the | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	