Let the inference object say what it can do, so the front ends stop naming models
Raised in review on #6780, and the same point as the one on #6776.
Three front ends now offer the same six things — espnet transcribe / translate / phonemize / align / synthesize / enhance (#6779), the MCP server's six tools (#6780), and the demo page — and each of them knows something about OWSM to do it:
espnet2/bin/mcp_server.py:_decodebuilds<asr>/<st_xxx>task symbols,_pr()reads POWSM's/phone/slashes.espnet2/bin/demo.py:phone_pass = task_sym == PHONE_TASK and not s2t.ctc_onlydecides what the page offers.espnet2/bin/cli.py:DEFAULT_MODELSmaps a command to a checkpoint, and_decodepasses task symbols.
The boundary we want is
front end (CLI / MCP / Space) -> capability -> model-specific implementationso that a second ASR or ST checkpoint does not add another branch to three files.
Part of this has already moved: #6776 put window_secs(s2t) and sample_rate(s2t) on Speech2Text rather than in demo.py, and no_language() answers from the checkpoint's own config and vocabulary instead of a hard-coded <nolang>. What is left is the tasks themselves — something like "can this checkpoint transcribe / translate into language X / give phones", answered by the inference object rather than asserted by the caller.
I would rather shape that interface against a second model than in the abstract: with one implementation it is a rename, with two it is an interface. Good candidates are an ESPnet ASR checkpoint that is not OWSM (so transcribe has a second implementation) and an ST model for translate.
Not urgent, and nothing in the open PRs is blocked on it.
Generated with Claude Code
Source: espnet/espnet