From 4e1dee0e8e06c1146d023c43812b88bfe2763329 Mon Sep 17 00:00:00 2001 From: Marc Sun <57196510+SunMarc@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:44:01 -0400 Subject: [PATCH] Revert "change version (#25387)" (#25573) This reverts commit 3a05e010e0c7e8abd3e5357dd4e89e28cc69003e. --- src/transformers/modeling_utils.py | 4 ++-- src/transformers/trainer.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py index 836cd3489811d2..c79a7fb061e802 100644 --- a/src/transformers/modeling_utils.py +++ b/src/transformers/modeling_utils.py @@ -2904,10 +2904,10 @@ def from_pretrained( model = replace_with_bnb_linear( model, modules_to_not_convert=modules_to_not_convert, quantization_config=quantization_config ) - # training in 8-bit is only available in 0.37.0+ but a major bug in 8-bit optimizers was fixed in 0.41.1 + # training in 8-bit is only available in 0.37.0+ model._is_quantized_training_enabled = version.parse( importlib.metadata.version("bitsandbytes") - ) >= version.parse("0.41.1") + ) >= version.parse("0.37.0") model.config.quantization_config = quantization_config model.is_8bit_serializable = is_8bit_serializable diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py index d738aa67b5d0dc..f870a50b3fe143 100755 --- a/src/transformers/trainer.py +++ b/src/transformers/trainer.py @@ -404,7 +404,7 @@ def __init__( else: raise ValueError( "The model you want to train is loaded in 8-bit precision. if you want to fine-tune an 8-bit" - " model, please make sure that you have installed `bitsandbytes>=0.41.1`. " + " model, please make sure that you have installed `bitsandbytes>=0.37.0`. " ) # Setup Sharded DDP training