From 0d408c6d06ae8bdc5c3df7c4bc762fd20aea2571 Mon Sep 17 00:00:00 2001 From: jhqxxx <18280426169@163.com> Date: Sat, 25 Apr 2026 18:47:00 +0800 Subject: [PATCH] fix voxcpm dtype bug --- src/models/voxcpm_refact/model.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/models/voxcpm_refact/model.rs b/src/models/voxcpm_refact/model.rs index a434f15..7229b83 100644 --- a/src/models/voxcpm_refact/model.rs +++ b/src/models/voxcpm_refact/model.rs @@ -376,7 +376,9 @@ impl VoxCPMModelRefact { let audio_len = audio_mask.sum_all()?.to_scalar::()? as usize; let context_len = audio_len.min(streaming_prefix_len - 1); let start = audio_feat.dim(1)? - context_len; - let last_feat = audio_feat.narrow(1, start, context_len)?; + let last_feat = audio_feat + .narrow(1, start, context_len)? + .to_dtype(self.dtype)?; pred_feat_seq.push(last_feat); } }