stt(phone): SttDebug переведён на Qwen3-ASR-0.6B (отладочный прогон wav)
This commit is contained in:
@@ -23,16 +23,24 @@ object SttDebug {
|
|||||||
// через: adb push /data/local/tmp/... + run-as pkg cp
|
// через: adb push /data/local/tmp/... + run-as pkg cp
|
||||||
val modelsDir = File(context.filesDir, "models")
|
val modelsDir = File(context.filesDir, "models")
|
||||||
val vadModel = File(modelsDir, "silero_vad.onnx").absolutePath
|
val vadModel = File(modelsDir, "silero_vad.onnx").absolutePath
|
||||||
val encoder = File(modelsDir, "small-encoder.int8.onnx").absolutePath
|
val convFrontend = File(modelsDir, "conv_frontend.onnx").absolutePath
|
||||||
val decoder = File(modelsDir, "small-decoder.int8.onnx").absolutePath
|
val encoder = File(modelsDir, "encoder.int8.onnx").absolutePath
|
||||||
val tokens = File(modelsDir, "small-tokens.txt").absolutePath
|
val decoder = File(modelsDir, "decoder.int8.onnx").absolutePath
|
||||||
|
val tokens = File(modelsDir, "tokenizer").absolutePath
|
||||||
|
|
||||||
log("[stt] создаём VAD...")
|
log("[stt] создаём VAD...")
|
||||||
val segments = VadSegmenter.vadSegments(wav.samples, vadModel)
|
val segments = VadSegmenter.vadSegments(wav.samples, vadModel)
|
||||||
log("[stt] фраз (VAD): ${segments.size}")
|
log("[stt] фраз (VAD): ${segments.size}")
|
||||||
|
|
||||||
log("[stt] создаём Whisper-small (int8, CPU)...")
|
log("[stt] создаём Qwen3-ASR-0.6B (int8, CPU)...")
|
||||||
val stt = WhisperStt(encoder, decoder, tokens, numThreads = 4)
|
val stt = Qwen3AsrStt(
|
||||||
|
convFrontendPath = convFrontend,
|
||||||
|
encoderPath = encoder,
|
||||||
|
decoderPath = decoder,
|
||||||
|
tokenizerDir = tokens,
|
||||||
|
numThreads = 4,
|
||||||
|
hotwords = "тулсет,тулы,умеешь",
|
||||||
|
)
|
||||||
val parts = ArrayList<String>()
|
val parts = ArrayList<String>()
|
||||||
for ((i, seg) in segments.withIndex()) {
|
for ((i, seg) in segments.withIndex()) {
|
||||||
val startMs = seg.first / 16
|
val startMs = seg.first / 16
|
||||||
|
|||||||
Reference in New Issue
Block a user