Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/omnivoice/src/eliza-asr-parakeet.inc
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ static int eliza_parakeet_load_locked(EliInferenceContext * ctx, char ** out_err
return 0;
}
pk_params pp = pk_default_params();
/* same policy as the Qwen3-ASR path: Android's CPU profile keeps ASR
* weights in private memory (ELIZA_ASR_USE_MMAP overrides) */
pp.use_mmap = eliza_asr_use_mmap() ? 1 : 0;
/* the GGUF is used in place, so map it on every platform, Android
* included (ELIZA_ASR_USE_MMAP=0 reads it into private memory) */
pp.use_mmap = eliza_parakeet_use_mmap() ? 1 : 0;
if (const char * env = std::getenv("ELIZA_ASR_THREADS")) {
const int n = std::atoi(env);
if (n > 0) pp.n_threads = n;
Expand Down
9 changes: 9 additions & 0 deletions tools/omnivoice/src/eliza-inference-ffi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,15 @@ static bool eliza_asr_use_mmap() {
return eliza_bool_env_or_default("ELIZA_ASR_USE_MMAP", !eliza_asr_android_cpu_profile());
}

// Parakeet-TDT (Phonon-2) reads its fv5 codes in place from the GGUF, so a
// mapping costs only clean, reclaimable page cache. A private copy is a
// ~320 MB anonymous allocation that a 4 GB Android device pushes to swap.
// mmap is therefore the default on every platform; ELIZA_ASR_USE_MMAP=0
// still selects the private copy.
static bool eliza_parakeet_use_mmap() {
return eliza_bool_env_or_default("ELIZA_ASR_USE_MMAP", true);
}

static bool eliza_asr_use_extra_bufts() {
return eliza_bool_env_or_default("ELIZA_ASR_USE_EXTRA_BUFTS", !eliza_asr_android_cpu_profile());
}
Expand Down
2 changes: 2 additions & 0 deletions tools/parakeet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ whose `asr/` holds a GGUF with `general.architecture = parakeet-tdt` loads this
word times.
- `eliza_inference_asr_stream_supported()` returns 1 and the `asr_stream_*` session runs `pk-stream`. The
stream does not return token ids, because Parakeet's vocabulary is not the text model's.
- The GGUF is memory-mapped on every platform, Android included, so its pages stay clean and reclaimable.
`ELIZA_ASR_USE_MMAP=0` reads it into private memory instead (about 320 MB of anonymous memory).
- `ELIZA_ASR_THREADS` sets the thread count. `ELIZA_ASR_STREAM_{RIGHT,HOP,MAX_WINDOW}_MS` tune the stream.

## Evidence boundary
Expand Down
Loading