Commit Graph
360 Commits
Author SHA1 Message Date
游雁 006d1d7856 docs: add vLLM engine and dynamic VAD to READMEs
- README.md: add vLLM/dynamic VAD to What's new, add vLLM row to features
- README_zh.md: same updates in Chinese
- Fun-ASR-Nano README/README_zh: add built-in vLLM and WebSocket service links
2026-05-24 19:39:41 +08:00
游雁 a23bdcd622 Merge branch 'vllm' - vLLM inference engine + streaming WebSocket service
Features:
- AutoModelVLLM: generic vLLM inference for all LLM-based ASR models
- serve_realtime_ws.py: streaming WebSocket ASR with VAD+SPK+hotwords
- DynamicStreamingVAD: dynamic silence threshold (default on for all models)
- Fun-ASR-Nano batch_size fix for VAD pipeline
- Comprehensive vLLM documentation (docs/vllm_guide.md)
2026-05-24 19:37:23 +08:00
xiaoyunchong.xyc d008cbf957 fix: Fun-ASR-Nano batch_size check - use len(data_in) instead of kwargs batch_size_ms 2026-05-24 19:17:17 +08:00
游雁 47e1c64666 feat: add subtitle generator tool (SRT/VTT from audio/video)
Verified: generates correct SRT output from audio files.
Supports speaker labels, multiple models, CPU/GPU.
2026-05-24 18:42:15 +08:00
xiaoyunchong.xyc 7be505f00e refactor: move DynamicStreamingVAD to funasr/models/fsmn_vad_streaming/ 2026-05-24 18:26:08 +08:00
xiaoyunchong.xyc ca352d992f feat: extract DynamicStreamingVAD as reusable component
- New funasr/utils/dynamic_vad.py: generic dynamic-threshold streaming VAD
- Supports both streaming (feed/finalize) and non-streaming (process) APIs
- Configurable silence_schedule for custom threshold curves
- Refactor serve_realtime_ws.py to use DynamicStreamingVAD
- Add documentation in vllm_guide.md appendix
2026-05-24 18:22:57 +08:00
xiaoyunchong.xyc c02734f184 docs: consolidate vLLM docs into single guide
- Merge vllm_inference.md + vllm_streaming.md + realtime_demo.md into docs/vllm_guide.md
- Single comprehensive document: overview, offline, streaming SDK, WebSocket service, API ref, FAQ
- Simplify realtime_demo.md to quick-start guide pointing to main doc
- Remove redundant vllm_inference.md and vllm_streaming.md
2026-05-24 18:10:09 +08:00
xiaoyunchong.xyc 84d24ab589 docs: add detailed inference logic section to realtime_demo.md 2026-05-24 18:05:39 +08:00
xiaoyunchong.xyc 6e3663c7ac docs: sync vllm_streaming.md with code - fix params, add AutoModelVLLM comparison 2026-05-24 18:03:06 +08:00
xiaoyunchong.xyc 55c035ff4d docs: fix vLLM version requirement, add AutoModelVLLM usage to vllm_inference.md 2026-05-24 18:00:34 +08:00
xiaoyunchong.xyc 9f0a2f9201 docs: add cross-references between vLLM docs 2026-05-24 17:58:09 +08:00
xiaoyunchong.xyc 753a0bbe67 docs: update realtime_demo.md with vLLM engine details 2026-05-24 17:47:08 +08:00
xiaoyunchong.xyc 81e2fc07ce feat: switch streaming ASR to vLLM inference via AutoModelVLLM
- Replace native PyTorch model.inference() with AutoModelVLLM.generate()
- Uses the generic vLLM engine (supports Fun-ASR-Nano and other LLM-based models)
- Add text cleaning for vLLM output artifacts
- Add vLLM args: --dtype, --tensor-parallel-size, --gpu-memory-utilization, --max-model-len
- RTF improved from 0.156 to 0.078 (2x faster)
2026-05-24 17:44:38 +08:00
xiaoyunchong.xyc 2ba80e1e02 docs: add language selection to API protocol 2026-05-24 17:18:46 +08:00
xiaoyunchong.xyc d3f9d85372 feat: add language selection for streaming ASR
- Server: --language arg + LANGUAGE: WebSocket command
- Client: language dropdown (Auto/中文/English/日本語/한국어/etc.)
- Protocol: LANGUAGE:<lang> sets target language dynamically
2026-05-24 17:16:41 +08:00
xiaoyunchong.xyc f720a28912 feat: polish streaming ASR service - cleanup, clients, docs
- Clean up serve_realtime_ws.py: remove debug logs, streamline code
- Add client_python.py: Python CLI client (mic/file/hotwords)
- Add client_test.py: automated test script (3 tests)
- Rewrite docs/realtime_demo.md: full deployment guide + API protocol
- Update client_mic.html: redesigned UI with speaker colors, hotword file
- Add hotword file support (热词列表, one word per line)
- Update requirements.txt
2026-05-24 17:11:57 +08:00
游雁 754440084b feat: add desktop voice input tool (语音输入法)
Press hotkey → record → auto-transcribe → paste to cursor.
Works with funasr-server as backend. Supports macOS/Linux/Windows.
No secondary development needed - just pip install and run.
2026-05-24 05:44:12 +08:00
游雁 6fdfac3115 docs(mcp): comprehensive setup guide for Claude/Cursor/Windsurf 2026-05-24 02:06:30 +08:00
游雁 25e9063132 feat(openai-api): production-ready server with full test coverage
- Proper error handling, logging, health endpoint
- Verified end-to-end with OpenAI Python SDK
- Models: sensevoice, paraformer, paraformer-en, fun-asr-nano
- Response formats: json, verbose_json (with segments/timestamps)
- Complete README with curl/SDK/LangChain examples
2026-05-24 02:05:54 +08:00
游雁 e1626914d4 docs: add blog post about agent integration 2026-05-24 01:59:47 +08:00
游雁 8d7be32c8f feat: add MCP server for AI assistant integration (Claude, Cursor)
Enables AI tools to call FunASR speech recognition via Model Context Protocol.
Supports transcribe_audio tool with auto language detection and speaker diarization.
2026-05-24 01:55:38 +08:00
游雁 96d0b72519 feat: add OpenAI-compatible API server for agent integration
Drop-in replacement for /v1/audio/transcriptions endpoint.
Works with any agent framework (LangChain, AutoGen, etc).
Supports sensevoice, paraformer, and fun-asr-nano models.
2026-05-24 01:54:05 +08:00
游雁 ac7e3ee8a2 fix: revert inference_batch_size for non-Paraformer models
Conformer, Transformer, and Branchformer models raise
NotImplementedError for batch decoding. Only Paraformer and
e_paraformer support batch_size>1 for inference. Revert the
non-Paraformer recipes back to batch_size=1.
2026-05-24 01:54:05 +08:00
游雁 0cbf26e0c7 fix: increase inference_batch_size from 1 to 32 in aishell recipes
The conformer, transformer, branchformer, and e_branchformer recipes
had inference_batch_size=1 which made GPU decoding extremely slow
(processing one utterance at a time). Changed to 32 to match the
paraformer recipe and utilize GPU parallelism during inference.
2026-05-23 21:21:02 +08:00
游雁 fc96102dee feat: add real-time WebSocket ASR demo with streaming VAD
- serve_realtime_ws.py: WebSocket server with per-segment decoding
  - Streaming VAD (fsmn-vad) for real-time sentence boundary detection
  - Only decodes current VAD segment (prevents long-audio collapse)
  - Confirmed segments locked immediately, never re-decoded
  - Supports unlimited recording duration

- client_mic.html: Browser client with mic capture
  - Real-time sentence-by-sentence display with timestamps
  - Confirmed lines (white) + ongoing partial (italic)
  - Audio visualizer, one-click start/stop

- docs/realtime_demo.md: Usage documentation
2026-05-23 16:06:25 +08:00
游雁 ed0ed9b7d4 feat: add real-time WebSocket ASR demo with streaming VAD
- serve_realtime_ws.py: WebSocket server with per-segment decoding
  - Streaming VAD (fsmn-vad) for real-time sentence boundary detection
  - Only decodes current VAD segment (prevents long-audio collapse)
  - Confirmed segments locked immediately, never re-decoded
  - Supports unlimited recording duration

- client_mic.html: Browser client with mic capture
  - Real-time sentence-by-sentence display with timestamps
  - Confirmed lines (white) + ongoing partial (italic)
  - Audio visualizer, one-click start/stop
2026-05-23 16:05:20 +08:00
游雁 3817ca31b3 feat: add streaming vLLM inference for Fun-ASR-Nano
Streaming ASR with 720ms chunks using vLLM batch generation:
- Cumulative audio re-encoding per chunk (encoder+adaptor)
- All chunks batched into single vLLM generate() call
- 8-character rollback for fixed/unfixed region tracking
- repetition_penalty=1.3 for stable short-audio output
- Output stabilizes after ~3s of audio

Files:
- funasr/models/fun_asr_nano/inference_vllm_streaming.py
- examples/.../docs/vllm_streaming.md
2026-05-23 00:59:40 +08:00
游雁 ffa66fbee4 feat: add vLLM inference support for Fun-ASR-Nano
Add high-throughput inference backend using vLLM for Fun-ASR-Nano model.
Key features:
- Automatic LLM weight extraction from model.pt to vLLM-compatible format
- Multi-GPU tensor parallelism support
- Batch inference with EmbedsPrompt API
- Character-level timestamps via CTC forced alignment
- Hotword and language customization

New files:
- funasr/models/fun_asr_nano/inference_vllm.py: Core vLLM engine
- examples/.../fun_asr_nano/demo_vllm.py: Demo script
- examples/.../fun_asr_nano/docs/vllm_inference.md: Usage documentation
2026-05-22 23:59:36 +08:00
游雁 4967c8bd8e feat: add Qwen3-ASR speaker diarization; remove unnecessary punc_model from SPK examples
- Qwen3-ASR: support spk_model with forced_aligner for speaker diarization
- Qwen3-ASR: fix list input handling (numpy/tensor to tuple format)
- Qwen3-ASR: output timestamp as [start_ms, end_ms] for pipeline compatibility
- Qwen3-ASR: graceful fallback when forced_aligner not configured
- Remove punc_model from Fun-ASR-Nano/SenseVoice/Qwen3-ASR SPK demos and tests
  (these models output punctuation natively)
- Fix test scripts to handle both text/sentence keys in sentence_info
- auto_model: set return_time_stamps=True when spk_model present
2026-05-21 04:38:21 +00:00
游雁 106cbb69a3 feat: add ERes2NetV2 speaker model with full AutoModel integration
Integrates ERes2NetV2 from 3D-Speaker into FunASR as a speaker
verification/diarization model. Can be used standalone or as spk_model
combined with VAD + ASR for speaker-attributed transcription.

Usage (standalone speaker embedding):
    model = AutoModel(model="iic/speech_eres2netv2_sv_zh-cn_16k-common")
    res = model.generate(input="audio.wav")
    embedding = res[0]["spk_embedding"]  # shape: [1, 192]

Usage (with ASR + speaker diarization):
    model = AutoModel(
        model="paraformer-zh",
        vad_model="fsmn-vad",
        spk_model="iic/speech_eres2netv2_sv_zh-cn_16k-common",
    )
    res = model.generate(input="audio.wav")

Tested end-to-end: ModelScope download + embedding extraction verified.

New files:
- funasr/models/eres2net/eres2netv2.py (network architecture)
- funasr/models/eres2net/model.py (FunASR wrapper with inference)
- tests_models/test_eres2netv2.py
- examples/industrial_data_pretraining/eres2netv2_sv/demo.py
- examples/industrial_data_pretraining/eres2netv2_sv/demo_sv.py
2026-05-20 05:27:53 +00:00
游雁 8a0c727051 feat: add GLM-ASR-Nano model support
Add GLMASR wrapper class integrating GLM-ASR-Nano-2512 (1.5B) into
FunASR. Uses HuggingFace transformers AutoModel + AutoProcessor with
trust_remote_code. Supports 17 languages with dialect and low-volume
speech optimization.

Usage:
    from funasr import AutoModel
    model = AutoModel(model="zai-org/GLM-ASR-Nano-2512", hub="hf", device="cuda:0")
    res = model.generate(input="audio.wav")

    # ModelScope (Chinese users)
    model = AutoModel(model="ZhipuAI/GLM-ASR-Nano-2512", hub="ms", device="cuda:0")

Tested end-to-end on CPU with Chinese and English audio.

New files:
- funasr/models/glm_asr/model.py
- funasr/models/glm_asr/__init__.py
- tests_models/test_glm_asr.py
- examples/industrial_data_pretraining/glm_asr/demo.py
- examples/industrial_data_pretraining/glm_asr/demo_ms.py

Note: requires transformers>=5.0.0 (pip install git+https://github.com/huggingface/transformers)
2026-05-20 04:15:11 +00:00
游雁 a837ac3954 fix: repair broken paraformer_streaming demo.py syntax 2026-05-20 04:05:46 +00:00
游雁 12e7e93ab5 docs: add Qwen3-ASR to README and examples
- Add Qwen3-ASR (0.6B/1.7B) to model zoo table in README.md and
  README_zh.md with links to HuggingFace and ModelScope
- Add news entry for Qwen3-ASR release
- Add example scripts:
  - examples/industrial_data_pretraining/qwen3_asr/demo.py (HuggingFace)
  - examples/industrial_data_pretraining/qwen3_asr/demo_ms.py (ModelScope)
2026-05-20 03:50:39 +00:00
游雁 10ac8cf39e feat: support SenseVoice speaker diarization (#2706)
- Auto-enable output_timestamp when spk_model is present in inference_with_vad
- Add SenseVoice + SPK demo and update README news/quick-start
2026-05-19 14:51:12 +00:00
游雁 a424f4c6b6 feat: support speaker diarization for Fun-ASR-Nano (#2844)
- Convert dict-format timestamps to list-format for downstream compatibility
- Fix spk_embedding to concatenate all chunk embeddings from sv_chunk
- Handle timestamps/timestamp key difference in vad_segment mode
- Auto fallback to vad_segment mode when punc_model is missing
- Add demo_spk.py example and test script
- Update README/README_zh with news and usage demo
2026-05-19 13:35:16 +00:00
ZZUZSL1024 a397d0b27e Codex/create training and inference scripts (#2791)
* Update funasr_wss_server.py

* Update funasr_wss_client.py

* Add files via upload

* Update funasr_wss_server.py

* Update funasr_wss_client.py

* Add LoRA Paraformer README
2026-02-04 19:49:29 +08:00
游雁 3e99d0e826 update 2026-01-26 20:57:57 +08:00
彭震东and启焚 7f9083daab add ct_tn.py (#2795)
Co-authored-by: 启焚 <[email protected]>
2026-01-26 20:46:21 +08:00
游雁 335eb1ea61 update 2026-01-26 20:39:06 +08:00
游雁 c42f2540cc fun-asr-nano 2025-12-16 00:46:16 +08:00
SnakeEye-sudo (Er. Sangam Krishna) 318f294fbd docs: Fix syntax error in real-time ASR example (Issue #2720) (#2730)
* docs: Fix syntax error in real-time ASR example (Issue #2720)

Added documentation to fix syntax error in real-time speech recognition example.

* docs: Add implementation guide for syntax error fix (Issue #2720)

Added a section detailing files needing updates for the total_chunk_num calculation syntax error, including examples and testing instructions.

* fix: Correct total_chunk_num syntax error in paraformer_streaming/demo.py

* Correct total_chunk_num calculation in demo.py

Fix calculation of total_chunk_num for speech processing.
2025-12-11 21:37:41 +08:00
Xuning Tan 8c6d1642f5 fix: correct the deepspeed_config path reference in the finetuning script (#2680) 2025-10-01 14:45:45 +08:00
Anjali Barge e175dae50b examples: add improved batch_asr CLI example with error handling (#2675)
* examples: add improved batch_asr CLI example with error handling

* examples: address PR feedback — use relative paths as keys, add --vad-model, remove unused import/cache
2025-09-20 22:39:57 +08:00
天地 3903d7c775 Update README_zh.md (#2436)
修正推理参数笔误
2025-03-18 14:36:27 +08:00
zhifu gao 3f8294b9d7 Revert "shfit to shift (#2266)" (#2336)
This reverts commit 1367973f98.
2024-12-25 17:16:11 +08:00
Rin Arakaki 1367973f98 shfit to shift (#2266) 2024-12-24 17:51:31 +08:00
Kun Zou b5ad7c81be Support eparaformer model on aishell1 recipe (#2327) 2024-12-21 17:13:46 +08:00
zhifu gao f921a71818 Update demo.py 2024-12-17 17:50:39 +08:00
游雁 fdafd3f6bc emotion2vec 2024-12-17 11:15:53 +08:00
shixian 026b8e3fdc update sensevoice small with timestamp 2024-12-05 19:29:19 +08:00