Skip to content

Commit ff18cb3

Browse files
committed
Bug fix
1 parent 362a9ac commit ff18cb3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

unsloth/models/_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = "2025.3.1"
15+
__version__ = "2025.3.2"
1616

1717
__all__ = [
1818
"SUPPORTS_BFLOAT16",

unsloth/tokenizer_utils.py

+7
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ def check_tokenizer(
859859

860860
import inspect
861861
from inspect import getsource
862+
import trl
862863
import trl.trainer.sft_trainer
863864
from trl.trainer.sft_trainer import *
864865
from transformers.trainer import *
@@ -1046,3 +1047,9 @@ def patch_sft_trainer_tokenizer():
10461047

10471048
# Finally patch TRL tokenizer things -> moved to RL
10481049
# patch_sft_trainer_tokenizer()
1050+
1051+
# Temporary measure to stop tokenizing data twice
1052+
if hasattr(trl, "data_utils"):
1053+
def maybe_apply_chat_template(example, *args, **kwargs): return example
1054+
trl.data_utils.maybe_apply_chat_template = maybe_apply_chat_template
1055+
pass

0 commit comments

Comments
 (0)