diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 632144afb7..989073c8fb 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -997,7 +997,7 @@ class FastLlamaModel: debug_info = """n_total_devices = total_train_batch_size // \\ args.gradient_accumulation_steps // self._train_batch_size - if n_total_devices > 2+2: + if n_total_devices > 2: logger.warning_once( "Our OSS was designed for people with few GPU resources to level the playing field.\\n" "The OSS Apache 2 license only supports four GPUs - please obtain a commercial license from our website.\\n" @@ -1027,16 +1027,16 @@ class FastLlamaModel: bsz = self._train_batch_size total_batches = bsz * ga * args.world_size n_total_devices = total_batches // ga // bsz - if n_total_devices > 2 * 2: + if n_total_devices > 2: logger.warning_once( "Please consider a commercial license - Unsloth was designed for the GPU Poor.\\n" "The OSS currently works on 4 GPUs - we're a 2 person team, so please help fund\\n" "our development costs by supporting us through Ko-fi or buying a license! Thanks!", ) - divisor = n_total_devices / 2 / 2 + divisor = n_total_devices / 2 bsz = self._train_batch_size = max(int(bsz / divisor), 1) - if total_batches // ga // bsz > 2 / 2: - divisor = n_total_devices / 2 / 2 + if total_batches // ga // bsz > 2: + divisor = n_total_devices / 2 ga = args.gradient_accumulation_steps = max(int(ga / divisor), 1)""" check_batches = check_batches.split('\n') check_batches = "\n".join([check_batches[0]] + [front_spaces + x[8:] for x in check_batches[1:]]) diff --git a/unsloth/models/mistral.py b/unsloth/models/mistral.py index 3dcad18201..1e1895d6d3 100644 --- a/unsloth/models/mistral.py +++ b/unsloth/models/mistral.py @@ -402,7 +402,7 @@ class FastMistralModel(FastLlamaModel): debug_info = """n_total_devices = total_train_batch_size // \\ args.gradient_accumulation_steps // self._train_batch_size - if n_total_devices > 2+2: + if n_total_devices > 2: logger.warning_once( "Our OSS was designed for people with few GPU resources to level the playing field.\\n" "The OSS Apache 2 license only supports four GPUs - please obtain a commercial license from our website.\\n" @@ -432,16 +432,16 @@ class FastMistralModel(FastLlamaModel): bsz = self._train_batch_size total_batches = bsz * ga * args.world_size n_total_devices = total_batches // ga // bsz - if n_total_devices > 2 * 2: + if n_total_devices > 2: logger.warning_once( "Please consider a commercial license - Unsloth was designed for the GPU Poor.\\n" "The OSS currently works on 4 GPUs - we're a 2 person team, so please help fund\\n" "our development costs by supporting us through Ko-fi or buying a license! Thanks!", ) - divisor = n_total_devices / 2 / 2 + divisor = n_total_devices / 2 bsz = self._train_batch_size = max(int(bsz / divisor), 1) - if total_batches // ga // bsz > 2 / 2: - divisor = n_total_devices / 2 / 2 + if total_batches // ga // bsz > 2: + divisor = n_total_devices / 2 ga = args.gradient_accumulation_steps = max(int(ga / divisor), 1)""" check_batches = check_batches.split('\n') check_batches = "\n".join([check_batches[0]] + [front_spaces + x[8:] for x in check_batches[1:]])