414 Commits
Author SHA1 Message Date
Grapette.L e7e61293d3 fix(frontend): read cmvn statistics without crashing on blank lines (#3760)
Both package cmvn readers index line_item[0] and lines[i + 1] without
checking, so a blank or whitespace-only line anywhere in the file
(trailing newline at EOF, a separator between sections) aborts frontend
construction with IndexError, and a file whose tags the walker does not
recognize returns empty statistics that only fail much later at inference.
Skip blank lines, bound the lookahead, and raise a ValueError naming the
file when neither <AddShift> nor <Rescale> parsed.
2026-10-08 14:50:05 +08:00
Mohammad Hijjawi 8f8931dc9a fix(paraformer): skip blank lines and read hotword files as UTF-8 (#3761)
SeACo-Paraformer and Contextual Paraformer turn every line of a hotword
.txt file into a hotword. A blank line (e.g. an extra newline at the end
of the file) became an empty hotword, and its zero length made
pack_padded_sequence raise "Length of all samples has to be greater
than 0" in the bias encoder, so inference failed.

The file was also opened with codecs.open() without an encoding, i.e.
the locale encoding. On Windows a UTF-8 Chinese hotword file decoded
into mojibake, so every hotword became <unk> (or reading raised
UnicodeDecodeError on GBK locales).

Read the local and downloaded hotword files as UTF-8 and skip blank
lines, matching parse_hotword_file() in funasr/utils/postprocess_hotwords.py.
2026-10-08 14:09:17 +08:00
Grapette.LandLesereingrape 22b42827a0 fix(auto): skip blank lines when reading wav.scp and jsonl file lists (#3758)
A blank or whitespace-only line in a file list crashes prepare_data_iterator:
the id/data branch indexes lines[0] on an empty split (IndexError), and the
.jsonl branch feeds an empty string to json.loads (JSONDecodeError). Skip
blank lines so a trailing or separator line no longer aborts the whole batch.

Co-authored-by: Lesereingrape <[email protected]>
2026-10-08 14:08:32 +08:00
Chi-Wei Lee d77b31d8c2 fix: retain unpunctuated tail in sentence timestamps (#3754) 2026-10-08 14:07:12 +08:00
Hulk d98f6eee4d fix(auto-model): preserve resampled rate for speaker inference (#3763) 2026-10-08 13:37:51 +08:00
zhifu gaoandLauraGPT 66d7a4c264 fix(realtime): recover merged long-segment partials (#3755)
Signed-off-by: LauraGPT <[email protected]>
Co-authored-by: LauraGPT <[email protected]>
2026-10-02 12:50:16 +08:00
LauraGPT 9d611293f4 feat(audio): support explicit PCM16 input without container probing
Signed-off-by: LauraGPT <[email protected]>
2026-10-01 15:17:23 +00:00
LauraGPT d7a33c862c Merge main with timestamp and event mapping fixes
Signed-off-by: LauraGPT <[email protected]>
2026-10-01 04:58:02 +00:00
LauraGPT 643f443ba2 fix(runtime): skip empty deduplicated event segments
Signed-off-by: LauraGPT <[email protected]>
2026-10-01 04:54:48 +00:00
Mohammad Hijjawi 217d10aa99 fix(sensevoice): stop rendering the Cough event as the Sneeze emoji (#3747)
rich_transcription_postprocess() maps SenseVoice event tags through
event_dict, which used 🤧 for both <|Sneeze|> and <|Cough|>, so coughs
were displayed as sneezes. emoji_dict and event_set already use 😷 for
coughs; use it in event_dict too, in funasr and in the funasr_onnx and
funasr_torch runtime copies.
2026-10-01 12:49:24 +08:00
Mohammad Hijjawi b0fa25b12c fix: keep token separators in timestamp_sentence raw_text (#3746)
timestamp_sentence() stripped the trailing space from sentence_text_seg
on every token instead of once when the sentence is emitted, so the
per-sentence raw_text lost all separators ("iphone pro max" became
"iphonepromax"). Trim it only at the sentence boundary, as
timestamp_sentence_en() already does.
2026-10-01 12:48:39 +08:00
Chi-Wei Lee 43329e8cef fix(hotwords): stop fuzzy postprocess matching from rewriting nearby text (#3744)
The fuzzy key was built with lazy_pinyin(errors="ignore"), which drops
every non-Chinese character. A window holding the hotword plus an
adjacent full stop, comma, digit or Latin letter got the same key as the
target and scored 1.0, and the tie-break on length then picked it, so
the replacement deleted that character. A Latin-only target such as
"FunASR" had an empty key and matched every Latin window of similar
length, overwriting the transcript.

Exact occurrences of a target were skipped but not reserved, so an
overlapping near match could still rewrite correct text and duplicate
the first character of the hotword.

Keep non-Chinese characters in the key, and drop a fuzzy candidate when
it overlaps an exact occurrence of the target it would write. Other
targets can still replace across that span, so a short target found
inside a longer one does not block the longer one.

Lower-cased Latin letters can spell pinyin, so a window with Latin
letters is only compared with targets that contain Latin letters, and a
window with Chinese characters only with targets that contain Chinese
characters. Targets that mix both scripts are compared with any window.

A window also may not start or end inside a run of ASCII letters or
digits, so a Latin target cannot rewrite part of a word or a number
(with target "Win11", "Win10" no longer becomes "Win110").
2026-10-01 12:47:56 +08:00
LauraGPT a31746dea0 docs: surface merged speech-to-speech SenseVoice integration
Signed-off-by: LauraGPT <[email protected]>
2026-09-30 16:36:43 +00:00
Chi-Wei Lee be7557f27c fix: stop timestamp_sentence_en reusing a stale sentence start (#3741)
When punc_id_list is longer than timestamp_postprocessed (a mismatch
the function already logs a warning for), the entries past the end of
timestamp_postprocessed get timestamp=None from zip_longest. For the
sentence that starts on one of those entries, the is_sentence_start
flag was consumed unconditionally on the first iteration regardless of
whether timestamp was None, so sentence_start kept whatever value was
left over from the previous, unrelated sentence instead of being
reported as unknown.

The sibling function timestamp_sentence already handles this correctly
by resetting sentence_start to None after each flush and only setting
it once a real timestamp shows up. Mirror that logic here instead of
the one-shot is_sentence_start flag.

Before: a trailing sentence whose first word has no timestamp gets
start reused from the previous sentence (wrong, looks valid).
After: start is None for that sentence, matching timestamp_sentence.
2026-09-30 22:52:09 +08:00
LauraGPT 9c9067f334 fix(auto): warn when unavailable accelerators fall back to CPU
Signed-off-by: LauraGPT <[email protected]>
2026-09-30 12:02:57 +00:00
li-lizhe 7f85ddd299 fix(amp): resolve autocast/GradScaler device type for non-CUDA accelerators (#3735)
* fix(amp): resolve autocast/GradScaler device type for non-CUDA accelerators

funasr/utils/amp.py pinned device_type="cuda" in the torch.amp compatibility shim, so on Ascend NPU (and XPU/MPS) builds torch.amp only warned "CUDA is not available ... Disabling autocast" and the context became a no-op: use_fp16/use_bf16 training silently ran in float32 and GradScaler(enabled=True) was silently disabled.

Resolve the device type from the running accelerator (torch.accelerator), the same policy funasr/models/fun_asr_nano/device_utils.py already applies to the inference path, and keep "cuda" as the historical no-op default when no accelerator is available so CPU behaviour is unchanged. GradScaler prefers an accelerator-specific implementation (e.g. torch.npu.amp.GradScaler) when one exists.

Signed-off-by: li-lizhe <[email protected]>

* fix(amp): honour an explicit device before choosing the GradScaler implementation

An explicit device (positional or keyword) now selects the scaler for that
device instead of the active accelerator, so GradScaler(device="cpu") no longer
reaches torch.npu.amp.GradScaler (its constructor has no device parameter and
raised TypeError) and GradScaler("cpu") no longer consumed "cpu" as init_scale.
The device argument is dropped before dispatching to an accelerator-specific
scaler and forwarded unchanged to the generic one; torch.cpu.amp is no longer
mistaken for a backend-specific scaler. Explicit keyword/positional/torch.device
coverage added.

Signed-off-by: li-lizhe <[email protected]>

* fix(amp): bind the generic GradScaler signature before native dispatch

The accelerator scalers do not share the generic torch.amp.GradScaler
positional order: torch_npu inserts `dynamic` before `enabled`, so
forwarding the caller's positional tail unchanged turned
GradScaler("npu", 1024.0, 2.0, 0.5, 2000, False) into an enabled static
scaler while the keyword form kept working. Bind a call written against
the generic signature to its parameter names first, drop the `device`
the accelerator constructor does not accept, and forward the rest by
name. Calls that do not match the generic signature keep the previous
plain re-export behaviour.

Tests: cover the positional enabled=False/True tail against a strict
torch_npu-signature stand-in (a *args/**kwargs recorder cannot detect a
shifted argument slot).

Signed-off-by: li-lizhe <[email protected]>

* docs(amp): narrow the _generic_arguments docstring claim

Signed-off-by: li-lizhe <[email protected]>

---------

Signed-off-by: li-lizhe <[email protected]>
2026-09-30 16:48:49 +08:00
zhifu gao 12e417f4fa Merge pull request #3736: correct LiteLLM website transcription route
Validate the combined website and SenseVoice tree against current main.

Signed-off-by: LauraGPT <[email protected]>
2026-09-29 14:43:39 +08:00
LauraGPT a57cc3f92a fix(sensevoice): keep words separate at standalone boundaries
Signed-off-by: LauraGPT <[email protected]>
2026-09-29 06:12:59 +00:00
LauraGPT 2ddabb2c91 fix(sensevoice): normalize first word before joining subpieces
Signed-off-by: LauraGPT <[email protected]>
2026-09-29 05:58:08 +00:00
LauraGPT f950854db3 fix(website): correct LiteLLM transcription route and guards
Signed-off-by: LauraGPT <[email protected]>
2026-09-29 03:10:14 +00:00
LauraGPT 99ef3b727b feat(benchmark): report first nonempty transcript latency
Signed-off-by: LauraGPT <[email protected]>
2026-09-28 13:36:31 +00:00
LauraGPT e7006a9315 fix: count speaker overlap once per diarization segment
Signed-off-by: LauraGPT <[email protected]>
2026-09-28 12:50:06 +00:00
Bruce-YiiandBruce-Yii 41778c45de fix(nano): correct punctuation timestamps across VAD merges (#3703)
* fix(nano): correct punctuation timestamps across VAD merges

Anchor zero-acoustic-mass punctuation at the preceding spoken token end (FunASR #3702). Reviewed patch only.

* fix(nano): keep byte-fragment spoken timestamps

* test(nano): cover byte-fragment timestamp preservation

* fix(nano): preserve semantic symbol timestamp spans

* test(nano): preserve semantic symbol timestamp spans

---------

Signed-off-by: Bruce-Yii <[email protected]>
Co-authored-by: Bruce-Yii <[email protected]>
2026-09-25 10:16:47 +08:00
li-lizhe bad0781a2e fix: use y.device instead of hardcoded .cuda() in data2vec compute_var (#3710)
* fix: use y.device instead of hardcoded .cuda() in data2vec compute_var

In compute_var(), zc = torch.tensor(y.size(0)).cuda() unconditionally
calls .cuda() which raises RuntimeError: Torch not compiled with CUDA
enabled on non-CUDA accelerators (Ascend NPU, XPU, HPU, MPS).

Use device=y.device to respect the input tensor's current device.

Signed-off-by: li-lizhe <[email protected]>

* test: add CPU/Gloo regression tests for data2vec compute_var

Cover both the uninitialized (no process group) branch and a real
2-rank Gloo process group with unequal local row counts, pinning the
device-agnostic contract introduced in the parent commit (PR #3710).

Signed-off-by: li-lizhe <[email protected]>

* fix(test): resolve compute_var import and f32_worker spawn pickle

* fix(test): ensure Manager and workers are cleaned up on failure paths

join(timeout) does not terminate a still-running worker, so a crashed or
hung rank could leak a subprocess on test failure. Wrap the two-rank
runner in try/finally that terminate()+join()s any alive worker and shuts
down the Manager.

Signed-off-by: li-lizhe <[email protected]>

---------

Signed-off-by: li-lizhe <[email protected]>
2026-09-21 10:28:58 +08:00
Hexu Zhao 782a7a99d5 [perf] Fun-ASR-Nano fine-tuning on B200: 0.244 s to 0.068 s per step at 1 GPU, mostly from cuDNN SDPA plan builds on every new batch shape (#3705)
* fun_asr_nano: opt-in scoped SDPA backends and compiled decoder for fine-tuning

* tests: FunASRNano opt-ins leave defaults untouched

* fun_asr_nano: declare the torch 2.3 floor the fine-tuning recipe needs
2026-09-21 10:20:05 +08:00
Xu Xiang 1878d61dbe fix(paraformer): correct timestamp alpha and peak argument order (#3716)
Pass CIF alpha weights and peak indices to the timestamp helper in its declared order and add boundary/content regressions. Fixes #3723.
2026-09-19 10:42:09 +08:00
Gmgge b096b7950f fix(campplus): bound clustering thread usage and spectrum work (#3699)
Apply ncpu to BLAS without rolling back torch OpenMP settings, compute only the required leading spectral pairs, and add regression coverage for repeated AutoModel construction and process-wide thread limits.
2026-09-19 10:32:10 +08:00
zhifu gao 904cd18681 Release FunASR 1.4.16 (#3719)
Prepare the 1.4.16 Python release, synchronize four-language release entry points, and make the native Transformers site contract follow the current package version.

Signed-off-by: LauraGPT <[email protected]>
2026-09-18 12:03:34 +08:00
zhifu gao 4d8e08748c Merge pull request #3706 from damnwenxi/fix/submodel-device-placement
fix: honor submodel device placement across inference calls
2026-09-16 10:27:29 +08:00
LauraGPT 1605ad20a3 test: isolate optional clustering dependency
Signed-off-by: LauraGPT <[email protected]>
2026-09-16 02:21:55 +00:00
zhifu gao fc98a60342 docs: correct strict ecosystem growth target
Signed-off-by: zhifu gao <[email protected]>
2026-09-15 23:34:51 +00:00
zhifu gao 8181a0225e docs: align bilingual roadmap with delivered milestones
Signed-off-by: zhifu gao <[email protected]>
2026-09-15 17:47:50 +00:00
zhifu gao 42a7f02d93 test(punctuation): guard SenseVoice documentation on exact PR heads
Signed-off-by: zhifu gao <[email protected]>
2026-09-15 14:30:57 +00:00
damnwenxi eee63614f0 test: avoid Python 3.11-only unittest cleanup API 2026-09-14 18:42:44 +08:00
damnwenxi aa353d6d22 fix: honor submodel device placement across inference calls 2026-09-14 09:20:40 +08:00
zhifu gao a111c75059 docs: clarify SenseVoice word timestamp alignment
Signed-off-by: zhifu gao <[email protected]>
2026-09-10 08:33:18 +00:00
zhifu gao 1d2307b1ab docs: distinguish native Transformers model downloads
Signed-off-by: zhifu gao <[email protected]>
2026-09-10 06:39:10 +00:00
zhifu gao b71671cd2a release(onnx): prepare 0.4.3 with installed artifact regressions
Signed-off-by: zhifu gao <[email protected]>
2026-09-09 22:58:58 +00:00
zhifu gao 0f370234a4 test(docs): derive current release checks from package version
Signed-off-by: zhifu gao <[email protected]>
2026-09-09 03:42:38 +00:00
zhifu gao 386e51cc15 release: prepare FunASR 1.4.15 with verified NumPy 2 compatibility
Signed-off-by: zhifu gao <[email protected]>
2026-09-09 03:23:15 +00:00
hylin 28fa5a4d64 fix: support NumPy 2 with verified scientific-stack compatibility (#3674)
Retain the contributor alias cleanup and remove the NumPy cap with verified CPU dependency, frontend, masking and clustering coverage.

NumPy 1.26.4 and 2.4.0 each pass 23 exact-head CI tests and 77 local tests plus 184 subtests. Existing EEND mel calls now use keyword arguments for modern librosa.

The related installation issue remains open pending published-package and reporter re-test.

Co-authored-by: linhongyu510 <[email protected]>
Signed-off-by: zhifu gao <[email protected]>
2026-09-09 10:59:37 +08:00
zhifu gao 4abb706cd5 feat(examples): add MOSS diarization to offline vLLM sample
Signed-off-by: zhifu gao <[email protected]>
2026-09-08 22:11:20 +00:00
zhifu gao cad08344f6 fix(training): rank checkpoints only with valid validation metrics
Signed-off-by: zhifu gao <[email protected]>
2026-09-08 21:07:19 +00:00
zhifu gao 2df180c636 fix(vad): exclude idle time from dynamic silence schedule
Signed-off-by: zhifu gao <[email protected]>
2026-09-08 20:15:17 +00:00
zhifu gao 53fbe89b65 test: keep rendering checks in the product-site suite
Signed-off-by: zhifu gao <[email protected]>
2026-09-08 18:41:03 +00:00
zhifu gao 5a2b449d3e docs: distinguish model checkpoints and serving interfaces
Signed-off-by: zhifu gao <[email protected]>
2026-09-08 18:28:55 +00:00
zhifu gao cdb6683516 docs: align deployment matrix recipes and fix copy icon contrast
Signed-off-by: zhifu gao <[email protected]>
2026-09-07 22:10:59 +00:00
zhifu gao 387e3f8782 docs: fix Kubernetes recipes and connect Gradio website guides
Signed-off-by: zhifu gao <[email protected]>
2026-09-07 21:18:26 +00:00
zhifu gao 0ae8a84832 docs: align root deployment recipes and CLI help with service contracts
Signed-off-by: zhifu gao <[email protected]>
2026-09-07 20:30:40 +00:00
zhifu gao 11198050ce docs: align Gradio guides with isolated MOSS serving profiles
Signed-off-by: zhifu gao <[email protected]>
2026-09-07 19:53:23 +00:00