Skip to content

feat: add funasr_asr_python local FunASR (SenseVoice) ASR extension#2191

Open
LauraGPT wants to merge 1 commit into
TEN-framework:mainfrom
LauraGPT:add-funasr-asr-extension
Open

feat: add funasr_asr_python local FunASR (SenseVoice) ASR extension#2191
LauraGPT wants to merge 1 commit into
TEN-framework:mainfrom
LauraGPT:add-funasr-asr-extension

Conversation

@LauraGPT

Copy link
Copy Markdown

Adds a funasr_asr_python ASR extension: a local, self-hosted speech-to-text backend powered by FunASR (SenseVoice / Fun-ASR-Nano / Paraformer). It mirrors the existing whisper_stt_python extension, swapping faster-whisper for a local FunASR model — strong on Chinese / Cantonese / Japanese / Korean, runs on CPU or CUDA, no API key.

What it does

  • FunASRExtension(AsyncASRBaseExtension) (vendor funasr), structured exactly like WhisperSTTExtension.
  • FunASRClient buffers 16-bit PCM, converts to float32, runs AutoModel.generate(...) off the event loop, and emits ASRResult via rich_transcription_postprocess. Default model iic/SenseVoiceSmall (auto language); swap to FunAudioLLM/Fun-ASR-Nano-2512 on GPU via config.
  • Config/manifest/property/addon/tests mirror the whisper extension; funasr is the only added dependency.

Testing

  • The core FunASRClient was verified end-to-end locally (16 kHz 16-bit PCM → FunASR → transcript via the result callback). All files pass ast syntax checks and the JSON manifests validate.
  • ten_runtime / ten_ai_base are not on PyPI, so the full in-framework wiring can't be imported standalone — the extension faithfully mirrors the working whisper_stt_python, and I'd appreciate CI / a maintainer confirming the framework integration. Happy to adjust.

@LauraGPT LauraGPT changed the title Add funasr_asr_python: local FunASR (SenseVoice) ASR extension feat: add funasr_asr_python local FunASR (SenseVoice) ASR extension Jun 22, 2026
@LauraGPT LauraGPT force-pushed the add-funasr-asr-extension branch from ede91cf to 43cbedc Compare June 22, 2026 21:40
@LauraGPT

Copy link
Copy Markdown
Author

CI note for reviewers: the only failing check is not a code/test failure.

I inspected claude-review (Claude Code Review) run 27985905295, job 82827178776. The action exits before reviewing the diff because this PR is from my fork and the actor only has read permission on TEN-framework/ten-framework:

Checking permissions for actor: LauraGPT
Permission level retrieved: read
Actor has insufficient permissions: read
Action failed with error: Actor does not have write permissions to the repository

So this check is blocked by the review action's permission policy for external contributors, not by the FunASR extension code. The PR remains MERGEABLE; it likely needs a maintainer-triggered review/run or a maintainer-side review path to clear that status.

@LauraGPT

LauraGPT commented Jul 7, 2026

Copy link
Copy Markdown
Author

Fresh FunASR/SenseVoice-side validation recheck (2026-07-07 UTC):

  • PR is open, non-draft, and mergeable; mergeable_state=blocked is currently the review/check gate. Current head is 43cbedce.
  • Review-thread audit shows 0 current unresolved review threads.
  • The only GitHub check failure I see is claude-review, which exits before reviewing because the fork actor has only read permission. I do not see a code/test failure attached to this head.
  • Local focused validation in a fresh checkout:
    • git diff --check origin/main...HEAD passed after fetching the merge base.
    • manifest.json and property.json parse as JSON.
    • python3 -m py_compile passed for the new funasr_asr_python Python files and tests/test_config.py.
    • The focused config tests passed with minimal local stubs for the TEN runtime packages that are normally materialized by the TEN package environment: PYTHONPATH=<stub>:ai_agents/agents/ten_packages/extension python3 -m pytest ai_agents/agents/ten_packages/extension/funasr_asr_python/tests/test_config.py -q -> 3 passed.

Caveat: my bare checkout does not include installed/materialized ten_runtime / ten_ai_base, so I did not run a full TEN runtime integration test locally. From the FunASR extension side, this looks ready for human maintainer review.

@LauraGPT

LauraGPT commented Jul 7, 2026

Copy link
Copy Markdown
Author

I checked the only failing check on this PR (claude-review). It is not failing on the FunASR extension code or tests.

The job exits before doing a review because the workflow sees the PR actor with read-only repository permission:

Checking permissions for actor: LauraGPT
Permission level retrieved: read
Actor has insufficient permissions: read
Action failed with error: Actor does not have write permissions to the repository

So the current red check is a Claude review workflow permission issue on pull_request_target, not a regression in the funasr_asr_python extension. A maintainer can either re-run/trigger that review workflow with trusted permissions or treat this check as non-actionable for the PR diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant