feat: improve error messages for better user-friendliness(改进错误消息的控制台输出以获得更佳的友好性)#2758
Open
mushroomcowisheggs wants to merge 1 commit intoRVC-Boss:mainfrom
Open
Conversation
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.
Summary:
A small improvement to error handling in
Text2SemanticDataset– adds file names and relevant values to error outputs, making issues easier to diagnose for non-developers, while retaining debugging traces.Changes:
Replace
assertfor file existence withFileNotFoundError+ path info.Wrap missing phoneme data and sequence conversion errors: print a user-friendly warning with the filename after the stack trace.
Wrap sequence conversion errors: ditto, print filename with the stack trace.
Wrap BERT-phoneme dimension assert: print filename and mismatched dimensions before re-raising.
Impact: No functional changes, only clearer error messages.
概述:
对
Text2SemanticDataset的错误处理进行小幅改进 —— 在错误输出中添加文件名和相关数值,便于普通用户快速定位问题,同时保留完整堆栈信息供开发者调试。修改内容:
文件存在性检查:将
assert改为显式FileNotFoundError,并输出具体文件路径。缺失 phoneme 数据:捕获异常后,打印堆栈并同时输出包含文件名的友好提示。
音素序列转换失败:同上,输出堆栈并且同时提示文件名。
BERT 特征维度断言:在
try/except中捕获断言失败,输出文件名及不匹配的维度值,然后重新抛出异常。影响范围:
仅修改错误输出方式,不影响核心逻辑和数据处理流程,对性能和正确性无影响。