fix: 修复多个模块中的独立 bug(distrib / spec_utils / text_seg / funasr)#2755
Open
wishhyt wants to merge 1 commit intoRVC-Boss:mainfrom
Open
fix: 修复多个模块中的独立 bug(distrib / spec_utils / text_seg / funasr)#2755wishhyt wants to merge 1 commit intoRVC-Boss:mainfrom
wishhyt wants to merge 1 commit intoRVC-Boss:mainfrom
Conversation
1. 修复 sync_buffer 中除以函数对象而非调用结果(distrib.py)
- `buffer.data /= world_size` 中 world_size 是函数,缺少 (),
导致 TypeError 使分布式训练 buffer 同步失败
2. 修复 istft 函数缺少 return 语句(spec_utils.py)
- 函数计算了结果但未返回,调用者始终得到 None
3. 修复 cut0 返回字面量 "/n" 而非换行符 "\n"(text_segmentation_method.py)
- 导致后续 text.split("\n") 无法正确切分,字面 /n 被当作文本内容
4. 修复粤语 ASR 的 vad/punc model_revision 被无条件覆盖(funasr_asr.py)
- 粤语分支将 vad_model_revision 设为空(因不使用 VAD/标点模型),
但 if/else 外的赋值将其覆盖为 "v2.0.4",传入错误的 revision 参数
Made-with: Cursor
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.
问题描述
修复分散在 4 个不同模块中的独立 bug:
1. [HIGH] distrib.py sync_buffer 除以函数对象
buffer.data /= world_size中world_size是函数(定义在第 21 行),缺少
()调用,导致TypeError。同文件第 108 行的sync_grad已正确使用world_size(),此处是遗漏。2. [HIGH] spec_utils.py istft() 缺少 return 语句
函数计算了
wave = np.asfortranarray([wave_left, wave_right])但未返回,所有调用者得到
None。3. [MEDIUM] text_segmentation_method.py cut0 返回 "/n" 而非 "\n"
cut0("不切"模式)在输入为纯标点时返回字面字符串"/n"而非换行符"\n"。后续
text.split("\n")无法正确切分,/n会作为文本内容传入 TTS 管线。4. [HIGH] funasr_asr.py vad_model_revision 被无条件覆盖
第 54 行
vad_model_revision = punc_model_revision = "v2.0.4"位于 if/elif/else块之外,将粤语分支(不使用 VAD/标点模型)中设置的空字符串覆盖为 "v2.0.4"。
修改内容
world_size→world_size()return wave"/n"→"\n"if language == "zh"分支内测试方案