Uh oh!
There was an error while loading. Please reload this page.
fix(asr): 过滤 GLM-ASR 偶发的纯井号占位转写(#787) - #916
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Uh oh!
There was an error while loading. Please reload this page.
User description
修复 issue #787:智谱 GLM-ASR 作为供应商时,静音/弱音片段偶发把整段识别为单个 #\(或 ##\…),当前 Whisper 兼容客户端仅 trim 后当作有效转写,导致占位符被插入用户输入。
改动
测试
新增 4 个单元测试(纯 #/##/### 归一化为空、混合分片丢弃占位、全占位整体为空、正常内容不受影响),\cargo test -p openless asr::whisper\ 33 个测试全部通过。
PR Type
Bug fix, Tests
Description
Filter GLM-ASR pure
#placeholder transcriptions.Normalize placeholder chunks to empty transcripts.
Add unit tests covering placeholder scenarios.
Guard real transcripts with other characters.
Diagram Walkthrough
flowchart LR A["ASR response text"] --> B{"is_placeholder_heading?"} B -- "yes" --> C["Empty transcript"] B -- "no" --> D["Normal transcript"] C --> E["Existing empty guard"]File Walkthrough
whisper.rs
Filter pure hash placeholders in ASR transcriptionsopenless-all/app/src-tauri/src/asr/whisper.rs
is_placeholder_headinghelper for pure#text.transcribe_chunkand fallback.C#and# 你好.