feat: add real-time caption CLI prototype with Qwen3-ASR
Add a C++/Qt6/CMake CLI prototype that captures the default sink monitor through libpulse and transcribes it in-process with Qwen3-ASR via libllama/libmtmd. Add phase 0/1 verification docs. 新增实时字幕命令行原型:libpulse 采集默认输出 monitor,进程内用 libllama/libmtmd 跑 Qwen3-ASR 推理。附阶段 0/1 验证文档。
This commit is contained in:
commit
18dbc9c8d3
18 files changed
+1682
No files matched your search
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# Phase 1 实机验证:实时采集默认输出 + 转写
|
||||
set -uo pipefail
|
||||
BIN=/home/blumia/Sources/live-caption/build/live-caption-cli
|
||||
M=${M:-/tmp/opencode/models/Qwen3-ASR-0.6B-Q8_0.gguf}
|
||||
MM=${MM:-/tmp/opencode/models/mmproj-Qwen3-ASR-0.6B-Q8_0.gguf}
|
||||
PLAY=${PLAY:-/tmp/opencode/samples/play_48k.wav}
|
||||
LOG=/tmp/opencode/live.log
|
||||
ERR=/tmp/opencode/live.err
|
||||
TIMEOUT=${TIMEOUT:-60}
|
||||
|
||||
"$BIN" --model "$M" --mmproj "$MM" --threads 8 > "$LOG" 2> "$ERR" &
|
||||
PID=$!
|
||||
echo "live-caption-cli pid=$PID, 等待模型加载..."
|
||||
sleep 4
|
||||
|
||||
echo "开始播放: $PLAY"
|
||||
paplay --device="$(pactl get-default-sink)" "$PLAY"
|
||||
|
||||
echo "播放结束,等 4s 让最后一段收尾..."
|
||||
sleep 4
|
||||
kill "$PID" 2>/dev/null
|
||||
wait "$PID" 2>/dev/null
|
||||
|
||||
echo "================ 实时输出 ================"
|
||||
tr '\r' '\n' < "$LOG" | grep -vE '^\s*$' | sed 's/\x1b\[[0-9;]*m//g'
|
||||
echo
|
||||
echo "================ 每次推理耗时 ================"
|
||||
grep '\[infer\]' "$ERR" || true
|
||||
Reference in new issue
Block a user