diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py index 100044b54b..32ebad60ba 100644 --- a/unsloth/dataprep/synthetic.py +++ b/unsloth/dataprep/synthetic.py @@ -26,6 +26,7 @@ import time from unsloth_zoo.vllm_utils import ( load_vllm, patch_vllm, + delete_vllm, ) import numpy as np @@ -189,6 +190,14 @@ class SyntheticDataKit: for _ in range(10): torch.cuda.empty_cache() gc.collect() + + # Delete vLLM module as well + # We delete llm.llm_engine.model_executor, so first make it accessible + class Dummy0: model_executor = 1 + class Dummy1: llm_engine = Dummy0() + class Dummy2: llm = Dummy1() + llm = Dummy2().llm.llm_engine.model_executor + delete_vllm(llm) pass def __enter__(self): return self diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index e4782b457b..90e0d9eb44 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2025.4.7" +__version__ = "2025.4.8" __all__ = [ "SUPPORTS_BFLOAT16",