From cc88d98ab81bd47aa0f5a4de7d6a6f49124baedb Mon Sep 17 00:00:00 2001 From: DangKai Date: Tue, 8 Apr 2025 16:22:10 +0800 Subject: [PATCH] fix empty_cache error in pt_weights_iterator (#5151) Co-authored-by: dangkai.dk --- python/sglang/srt/model_loader/weight_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/sglang/srt/model_loader/weight_utils.py b/python/sglang/srt/model_loader/weight_utils.py index b71f9ff3d..2f21d55c0 100644 --- a/python/sglang/srt/model_loader/weight_utils.py +++ b/python/sglang/srt/model_loader/weight_utils.py @@ -457,7 +457,6 @@ def pt_weights_iterator( state = torch.load(bin_file, map_location="cpu", weights_only=True) yield from state.items() del state - torch.cuda.empty_cache() def get_gguf_extra_tensor_names(