From fa7e17db0df3f0779ec094880c22e6b4f2856580 Mon Sep 17 00:00:00 2001 From: bdim404 Date: Thu, 5 Feb 2026 10:42:23 +0800 Subject: [PATCH] feat: Update temperature, top_k, and top_p parameters in CustomVoiceForm and VoiceCloneForm for improved voice synthesis --- .../src/components/tts/CustomVoiceForm.tsx | 32 ++++++++----------- .../src/components/tts/VoiceCloneForm.tsx | 6 ++-- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/qwen3-tts-frontend/src/components/tts/CustomVoiceForm.tsx b/qwen3-tts-frontend/src/components/tts/CustomVoiceForm.tsx index c3a981b..820a004 100644 --- a/qwen3-tts-frontend/src/components/tts/CustomVoiceForm.tsx +++ b/qwen3-tts-frontend/src/components/tts/CustomVoiceForm.tsx @@ -48,9 +48,9 @@ const CustomVoiceForm = forwardRef((_props, ref) => { const [advancedOpen, setAdvancedOpen] = useState(false) const [tempAdvancedParams, setTempAdvancedParams] = useState({ max_new_tokens: 2048, - temperature: 0.3, - top_k: 20, - top_p: 0.7, + temperature: 0.9, + top_k: 50, + top_p: 1.0, repetition_penalty: 1.05 }) @@ -79,9 +79,9 @@ const CustomVoiceForm = forwardRef((_props, ref) => { speaker: '', instruct: '', max_new_tokens: 2048, - temperature: 0.3, - top_k: 20, - top_p: 0.7, + temperature: 0.9, + top_k: 50, + top_p: 1.0, repetition_penalty: 1.05, }, }) @@ -103,9 +103,9 @@ const CustomVoiceForm = forwardRef((_props, ref) => { setValue('instruct', params.instruct || '') setValue('max_new_tokens', params.max_new_tokens || 2048) - setValue('temperature', params.temperature || 0.3) - setValue('top_k', params.top_k || 20) - setValue('top_p', params.top_p || 0.7) + setValue('temperature', params.temperature || 0.9) + setValue('top_k', params.top_k || 50) + setValue('top_p', params.top_p || 1.0) setValue('repetition_penalty', params.repetition_penalty || 1.05) } })) @@ -168,9 +168,6 @@ const CustomVoiceForm = forwardRef((_props, ref) => { voice_design_id: selectedItem.designId, max_new_tokens: data.max_new_tokens, temperature: data.temperature, - top_k: data.top_k, - top_p: data.top_p, - repetition_penalty: data.repetition_penalty, backend: 'local', }) } else { @@ -181,9 +178,6 @@ const CustomVoiceForm = forwardRef((_props, ref) => { saved_design_id: selectedItem.designId, max_new_tokens: data.max_new_tokens, temperature: data.temperature, - top_k: data.top_k, - top_p: data.top_p, - repetition_penalty: data.repetition_penalty, }) } } else { @@ -338,9 +332,9 @@ const CustomVoiceForm = forwardRef((_props, ref) => { if (open) { setTempAdvancedParams({ max_new_tokens: watch('max_new_tokens') || 2048, - temperature: watch('temperature') || 0.3, - top_k: watch('top_k') || 20, - top_p: watch('top_p') || 0.7, + temperature: watch('temperature') || 0.9, + top_k: watch('top_k') || 50, + top_p: watch('top_p') || 1.0, repetition_penalty: watch('repetition_penalty') || 1.05 }) } @@ -390,7 +384,7 @@ const CustomVoiceForm = forwardRef((_props, ref) => { value={tempAdvancedParams.temperature} onChange={(e) => setTempAdvancedParams({ ...tempAdvancedParams, - temperature: parseFloat(e.target.value) || 0.3 + temperature: parseFloat(e.target.value) || 0.9 })} />

diff --git a/qwen3-tts-frontend/src/components/tts/VoiceCloneForm.tsx b/qwen3-tts-frontend/src/components/tts/VoiceCloneForm.tsx index e0f421c..ee545bb 100644 --- a/qwen3-tts-frontend/src/components/tts/VoiceCloneForm.tsx +++ b/qwen3-tts-frontend/src/components/tts/VoiceCloneForm.tsx @@ -71,9 +71,9 @@ function VoiceCloneForm() { use_cache: true, x_vector_only_mode: false, max_new_tokens: 2048, - temperature: 0.3, - top_k: 20, - top_p: 0.7, + temperature: 0.9, + top_k: 50, + top_p: 1.0, repetition_penalty: 1.05, } as Partial, })