From 9611ee433ebe74be46b75010c09f711f64757e7d Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 29 Dec 2024 19:36:11 -0800 Subject: [PATCH] Update __init__.py --- unsloth/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unsloth/__init__.py b/unsloth/__init__.py index 10bcd25088..afd255dc35 100644 --- a/unsloth/__init__.py +++ b/unsloth/__init__.py @@ -106,12 +106,12 @@ try: text = f.read() # See https://github.com/facebookresearch/xformers/issues/1176#issuecomment-2545829591 if "num_splits_key=-1," in text: - print("Unsloth: Patching Xformers to fix some performance issues.") text = text.replace("num_splits_key=-1,", "num_splits_key=None,") + f.seek(0) + f.write(text) + f.truncate() + print("Unsloth: Patching Xformers to fix some performance issues.") pass - f.seek(0) - f.write(text) - f.truncate() pass pass pass