Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Feat/kto (#1316)

Eddae7aabd648f5
diff --git a/unsloth/models/__init__.py b/unsloth/models/__init__.py
index 3230cdc2072..9c032b28bda 100644
--- a/unsloth/models/__init__.py
+++ b/unsloth/models/__init__.py
@@ -16,5 +16,5 @@ from .loader import FastLanguageModel, FastVisionModel
from .llama import FastLlamaModel
from .mistral import FastMistralModel
from .qwen2 import FastQwen2Model
-from .dpo import PatchDPOTrainer
+from .dpo import PatchDPOTrainer, PatchKTOTrainer
from ._utils import is_bfloat16_supported
diff --git a/unsloth/models/dpo.py b/unsloth/models/dpo.py
index e7074350c3c..5dc71f920aa 100644
--- a/unsloth/models/dpo.py
+++ b/unsloth/models/dpo.py
@@ -14,6 +14,7 @@
__all__ = [
"PatchDPOTrainer",
+ "PatchKTOTrainer",
]
try:
@@ -127,4 +128,4 @@ def PatchDPOTrainer():
pass
pass
pass
-
+PatchKTOTrainer = PatchDPOTrainer