feat(stream): add incremental streaming decode with 8s slice reuse
Add native streaming ASR: 8s-aligned audio slices are cached in the KV cache, only new audio is encoded, and the previous text is fed back as an assistant prefix with token rollback. Text matches offline results. Streaming keeps each step within the 2s budget for segments up to 20s. 新增原生流式解码:8s 对齐的音频切片存入 KV 复用,只编码新音频,并把 上一轮文本作为 assistant 前缀回喂(带 token 回滚)。转写结果与离线 一致;20s 以内的段落每步计算都在 2s 预算内。
This commit is contained in:
1 parent
18dbc9c8d3
commit
21d68e2294
8 files changed
+678
-34
No files matched your search
@@ -9,7 +9,7 @@ Linux 桌面实时字幕:采集系统正在播放的声音,实时转写成
|
||||
|---|---|---|
|
||||
| Phase 0 | 可行性验证(采集 / 模型 / CPU 实时性) | ✅ 见 [docs/phase0-verification.md](docs/phase0-verification.md) |
|
||||
| Phase 1 | 命令行原型(进程内推理 + monitor 采集 + 滑窗 + 稳定前缀) | ✅ 见 [experiments/phase1/README.md](experiments/phase1/README.md) |
|
||||
| Phase 2 | 原生流式解码(前缀回滚 + 滑窗,去掉 VAD) | 待做,见 [docs/phase2-streaming.md](docs/phase2-streaming.md) |
|
||||
| Phase 2 | 原生流式解码(8s 切片 + 增量 KV 复用 + 前缀回滚) | ✅ 见 [docs/phase2-streaming.md](docs/phase2-streaming.md) |
|
||||
| Phase 3 | Qt 悬浮字幕窗(折叠/展开、语言标签、置顶) | 待做 |
|
||||
| Phase 4 | 设置界面(模型切换、语言、字体、位置) | 待做 |
|
||||
| Phase 5 | Wayland 支持、打包、模型分发 | 待做 |
|
||||
|
||||
Reference in new issue
Block a user