feat: add FunASR speech recognition backend - #10090
Conversation
|
Hi @mudler, friendly ping — this PR adds FunASR as a speech recognition backend for LocalAI. Ready for review whenever convenient. Thanks! |
|
Hi @mudler, friendly follow-up — this PR adds FunASR as a speech recognition backend for LocalAI. FunASR recently added an agent-friendly CLI ( |
c2ddbf3 to
74c6596
Compare
|
Rebased onto the latest |
fd9fd5f to
8105d38
Compare
|
Rebased this PR onto the latest Current state:
Local checks run: ruby -e 'require "yaml"; data=YAML.load_file("backend/index.yaml"); names=data.select { |x| x.is_a?(Hash) }.map { |x| x["name"] }; abort("missing funasr") unless names.include?("funasr"); abort("missing cpu-funasr") unless names.include?("cpu-funasr"); abort("missing metal-supertonic") unless names.include?("metal-supertonic"); puts "index ok: #{data.length} entries"'
python3 -m py_compile backend/python/funasr/backend.py
rg -n "<<<<<<<|=======|>>>>>>>" backend/index.yaml backend/python/funasr || true
git diff --check upstream/master...HEAD |
|
Quick maintainer-side validation pass after the latest rebase:
I did not run a full dependency install or model transcription in this bare ops environment, but the registry wiring and backend entrypoint syntax look clean from this pass. |
|
One caveat from a deeper pass so the validation note above is not read as a ready-to-merge sign-off: So the registry wiring, syntax, and requirement-file checks are clean, but the |
|
Follow-up on the test caveat I noted earlier: I pushed signed head What it covers without downloading FunASR weights:
Validation on the refreshed branch: Note: running |
f258f5f to
bc41281
Compare
|
Rebased this PR onto current Current head is Validation run locally on the rebased branch:
GitHub DCO is passing on the new head. |
|
I pulled the failing fork-side The job reaches the CodeQL/code-scanning upload step and fails because the fork token cannot access the CodeQL API endpoints: So the visible failing For the FunASR backend itself, the latest local validation remains: |
|
Pushed signed head This update fixes three runtime gaps found during that pass:
Verification on
The PR description now contains the complete reproducible verification summary. Ready for review. Follow-up for signed head b970f89:
The upstream DCO check is green. The other eight workflows currently show action_required with zero jobs, so there is no failing log to address from the contributor side. @mudler, could you approve those workflow runs and review the backend when convenient? |
|
@mudler, could you take a look at this FunASR backend when convenient? The branch is current with master and DCO passes. I have now exercised the actual LocalAI install, unit-test helper, CPU and CUDA SenseVoice inference, and gRPC LoadModel/AudioTranscription paths; all returned clean OpenAI-compatible text, and the six focused tests pass. There are no remaining code-owned CI failures on the PR head. Exact-head update for
|
|
Refreshed the branch to current Fresh verification on this exact head:
GitHub now reports the PR as mergeable with DCO passing. It is ready for maintainer review. |
|
Synced the branch with current Fresh exact-head verification:
GitHub reports the PR mergeable with DCO green and 0 commits behind |
|
Thanks @LauraGPT, this is a notably complete backend PR, better wired than most first-time external backends. I verified the full build/matrix/index/Makefile surface and it is internally consistent:
Two things to address before merge: 1. Importer / 2. mps / xpu image variants are advertised but unverified. Quality follow-ups (non-blocking, could be later PRs):
Really nice work overall. Address (1) and (2) and this is close. Happy to re-review once updated. |
|
Addressed both pre-merge requirements at exact head
Fresh exact-head validation:
@localai-bot, ready for re-review. |
|
Synced this PR with current Fresh validation on this exact head:
GitHub reports the PR as mergeable with DCO green; remaining gate is maintainer review. |
|
Synced this FunASR backend PR with the latest Head: The upstream merge only touched Fresh local validation on bash backend/python/funasr/test.sh
python3 -m compileall -q backend/python/funasr
bash -n backend/python/funasr/run.sh backend/python/funasr/test.sh
PATH=/cpfs_speech/user/zhifu.gzf/.cache/funasr-ops/go1.26.4/bin:$PATH go test -count=1 ./core/gallery/importers
PATH=/cpfs_speech/user/zhifu.gzf/.cache/funasr-ops/go1.26.4/bin:$PATH go test -count=1 ./core/http/endpoints/localai -ginkgo.focus='GET /backends/known'
make -n docker-build-funasr
# FunASR matrix/index assertions
git diff --checkResults:
The branch is now 0 commits behind the target branch and remains mergeable; the remaining gate is maintainer review. |
|
Synced this FunASR backend PR with current Fresh validation on this synced head: I attempted the focused Go tests for |
|
LocalAI master advanced again right after the previous sync, so I pulled the latest Fresh validation: |
|
Synced this FunASR speech-recognition backend PR with current New head is Focused validation on the synced head: python3 -m py_compile backend/python/funasr/backend.py backend/python/funasr/test.py
python3 backend/python/funasr/test.py
git diff --check origin/master...HEAD
make protogen-go
go test ./core/gallery/importers -run 'FunASR|Importers' -count=1
go test ./core/http/endpoints/localai -run 'Backend' -count=1Results:
GitHub currently reports the PR as mergeable with no failed or pending checks; remaining state is reviewer approval ( |
Signed-off-by: zhifu gao <zhifu.gzf@alibaba-inc.com>
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
Signed-off-by: LauraGPT <LauraGPT@users.noreply.github.com>
56d7ac9 to
0f297b4
Compare
|
@mudler I rebased this onto current |
Signed-off-by: LauraGPT <lauragpt@users.noreply.github.com>
|
@mudler reviewed the contributor-updated head |
Summary
Adds FunASR as a speech recognition backend for LocalAI.
FunASR is an industrial-grade ASR toolkit from Alibaba DAMO Academy, featuring:
Changes
backend/python/funasr/funasrmodel configurationstorchaudioalongside every explicitly installed Torch profileUsage
The backend supports the standard
/v1/audio/transcriptionsendpoint with an optionallanguageparameter.Verification
0e2ad672is 0 commits behindmasterat76ce4f59; the PR is mergeable after the upstream refreshHealth,LoadModel, andAudioTranscriptionsucceeded throughBackendStubfunasr==1.3.29: officialiic/SenseVoiceSmallloaded and transcribed the FunASR sample as欢迎大家来体验达摩院推出的语音识别模型make protogen-gocompleted with no tracked driftgo test -count=1 ./core/gallery/importersgo test -count=1 ./core/http/endpoints/localai -ginkgo.focus='GET /backends/known'py_compile,bash -n, andgit diff --checkmake -n docker-build-funasrandmake -n docker-build-vllm-cpp, including exact backend names, image tags, and DockerfilesThe default
iic/SenseVoiceSmallmodel identifier remains unchanged.