Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions vllm_omni/model_executor/models/fish_speech/dac_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def _load_dac_codec(
if "generator" in state_dict:
state_dict = state_dict["generator"]
codec.load_state_dict(state_dict, strict=False)
# Encoder path only uses encoder + quantizer.forward(); prune the
# decoder before moving to device to avoid unnecessary GPU allocation.
codec.decoder = None
codec = codec.to(device=device, dtype=dtype)
codec.eval()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ def _ensure_codec_loaded(self) -> None:
self._bake_weight_norm(codec)
self._cache_attention_masks(codec)

# Decode path only uses quantizer.decode() + decoder; prune
# encode-only components before moving to device to avoid
# unnecessary GPU allocation.
codec.encoder = None
codec.quantizer.pre_module = None
codec.quantizer.downsample = None

device = self.vllm_config.device_config.device
codec = codec.to(device=device, dtype=torch.float32)
codec.eval()
Expand Down
Loading