fix: preserve speaker_encoder in checkpoints and improve sample rate error#222
Open
haosenwang1018 wants to merge 1 commit intoQwenLM:mainfrom
Open
Conversation
…error Two fixes for the finetuning script: 1. Stop deleting speaker_encoder weights from checkpoints. The deletion makes resume training impossible because the model crashes on the next forward pass with NoneType error. A comment explains the rationale for keeping them. 2. Improve the sample rate assertion error message to show the actual detected sample rate and suggest the ffmpeg conversion command, reducing user confusion. Fixes QwenLM#204 Signed-off-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two issues in the finetuning script (
sft_12hz.py/dataset.py):1. speaker_encoder deleted from checkpoints — resume impossible
Lines 150-153 of
sft_12hz.pyexplicitly deletespeaker_encoderweights before saving:When resuming from a checkpoint,
model.speaker_encoder = None→ crash on the next forward pass.2. Unhelpful sample rate error message
dataset.py:105assertssr == 24000but doesn't show the detected sample rate or suggest a fix, leaving users confused.Fix
Fixes #204