276 Commits
Author SHA1 Message Date
HaechiandPurfview 846467d436 Make collect_chunks() linear in the number of chunks (#1692)
* Make collect_chunks() linear in the number of chunks

collect_chunks() grew its output with np.concatenate() inside the loop,
so every chunk copied all the audio merged so far. Collect the slices
instead and join each group once, when it's complete.

Fixes #1690

* Delete tests/test_vad.py

---------

Co-authored-by: Purfview <69023953+Purfview@users.noreply.github.com>
2026-11-06 17:24:51 +00:00
Purfview 2a3a857737 Fix CI failure caused by ubuntu-latest migration (#1686)
* Fix CI failure caused by ubuntu-latest migration
2026-11-02 11:19:10 +00:00
Purfview 9e472ae9de Raise an error for languages unsupported by a model (#1564)
* Raise an error for languages unsupported by a model

Close: https://github.com/SYSTRAN/faster-whisper/issues/1228
2026-10-16 12:12:55 +01:00
Purfview 47e2558a88 Raise an error for illegal values in clip_timestamps arg (#1654)
* Raise an error for illegal values in collect_chunks {input from clip_timestamps arg and and get_speech_timestamps]
2026-10-16 12:00:49 +01:00
Purfview 2486efd9e9 Verify that config.json has the required keys (#1673)
Verify that config.json has the required keys.
2026-10-16 11:45:24 +01:00
sungbin1015 c45e1739de Accept a dict for vad_parameters in detect_language (#1662)
* Accept a dict for vad_parameters in detect_language
2026-10-15 21:19:35 +01:00
Purfview a52b026ac8 Tweak collect_chunks() (#1653)
A new group opens with missing "segments".

Not a bug in the API as "segments" metadata is not in use down stream.

Detected by some AI bot there: https://github.com/SYSTRAN/faster-whisper/pull/1491
2026-10-10 04:39:41 +01:00
Joyce Yee 9fa78645d7 Update the initial_prompt parameter type hint in batched pipeline (#1299)
Update the initial_prompt parameter type hint in batched pipeline

* Update transcribe.py
2026-10-06 21:10:47 +01:00
cdac682679 change language_detection_threshold type to float (#1188)
* change language_detection_threshold type to float

Cannot be an optional parameter

* remove test edit

* apply same to BatchedInferencePipeline

---------

Co-authored-by: extrange <nicholas_leong@nuhs.edu.sg>
Co-authored-by: Purfview <69023953+Purfview@users.noreply.github.com>
2026-10-06 13:33:46 +01:00
Mustafa AkcancaandPurfview f6ef59b5e3 Handle empty alignments in find_alignment (companion to the CTranslate2 divide-by-zero fix for #1342) (#1460)
* Handle empty alignments in find_alignment

ctranslate2 returns an empty alignment for a window that has no frames
left after the encoder-stride halving (num_frames < 2, e.g. a ~10ms
final VAD chunk on audio where Whisper hallucinates past the clip end;
see OpenNMT/CTranslate2#2065). find_alignment then crashed with
IndexError at time_indices[jumps] because the boolean mask is padded to
length 1 while the indexed array is empty.

Return an empty word list for such segments instead: the segment simply
carries no word timestamps.

Fixes #1342 (together with the ctranslate2 fix, which replaces the
process-killing 0xC0000094 native crash with the empty alignment this
change handles).

* Comment edit

---------

Co-authored-by: Purfview <69023953+Purfview@users.noreply.github.com>
2026-10-06 00:12:29 +01:00
Gregory TzarandPurfview 70a1626a41 Update export LD_LIBRARY_PATH cmd in README.md (#1459)
Co-authored-by: Purfview <69023953+Purfview@users.noreply.github.com>
2026-10-05 08:43:09 +01:00
Purfview 7b99be5376 Comment edit: Clarify chunk_length usage (#1536)
Added clarification on chunk_length usage after noticing some unexpected uses of this argument.

Some people even use it to shorten the text segments instead of post-processing the text. :)
2026-10-01 15:01:31 +01:00
Jürgen Fleiß 2ce7f9d7a9 Adopt av.open usage according to PyAV 19.0.0 (#1495) 2026-09-30 19:50:01 +03:00
PurfviewandMahmoud Ashraf ed9a06cd89 Adds new VAD parameters (#1386)
* Adds new VAD parameters

Adds new VAD parameters: 

min_silence_at_max_speech: Minimum silence duration in ms which is used to avoid abrupt cuts when max_speech_duration_s is reached.

use_max_poss_sil_at_max_speech: Whether to use the maximum possible silence at max_speech_duration_s or not. If not, the last silence is used.

* Style

* Update doc

* change min_speech_duration_ms (0 -> 250)

* Change min_speech_duration_ms to zero

Set minimum speech duration to zero for flexibility.

---------

Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com>
2025-11-19 17:40:46 +03:00
Purfview 2eeafe05de Update Silero-VAD weights to v6.2 (#1390)
* Update Silero-VAD weights to v6.2

Overall slight quality improvement (no metrics update);
Higher stability on OOD / rare / strange / unique data;
Significant quality improvements on various known edge cases:

    Unusual voices
    Child voices
    Cartoon voices
    Muted voices
    Muted speech
    Lower quality phone calls

https://github.com/snakers4/silero-vad/releases/tag/v6.2

* Changes: tiny -> base in test_monotonic_timestamps()
2025-11-19 17:14:42 +03:00
Purfview cf42429f96 Remove "local_dir_use_symlinks" from download_model() (#1389)
* Remove "local_dir_use_symlinks" from download_model()

It's deprecated since huggingface_hub v0.23.0 and produce this warning:

>   /opt/hostedtoolcache/Python/3.9.24/x64/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py:202: UserWarning: The `local_dir_use_symlinks` argument is deprecated and ignored in `snapshot_download`. Downloading to a local directory does not use symlinks anymore.

* Bump huggingface_hub requirement to v0.23
2025-11-18 21:59:01 +03:00
Mahmoud Ashraf 65882eee9f Bump version to 1.2.1 v1.2.1 2025-10-31 14:31:14 +03:00
Mahmoud Ashraf 409a6919f9 Prevent timestamps restoration when clip timestamps are provided in batched inference (#1376) 2025-10-31 14:26:17 +03:00
Mahmoud Ashraf 00a5b26b1f Offload retry logic to hf hub (#1382)
* remove requirement for requests
2025-10-30 22:11:01 +03:00
Purfview 9090997d25 Fix a typo (#1377) 2025-10-22 15:51:56 +03:00
Mahmoud Ashrafandsssshhhhhh 193317444+sssshhhhhh@users.noreply.github.com dea24cbcc6 Upgrade to Silero-VAD V6 (#1373)
Co-authored-by: sssshhhhhh 193317444+sssshhhhhh@users.noreply.github.com
2025-10-14 15:29:56 +03:00
MarioandMahmoud Ashraf 14ba1051f3 Fix: add <|nocaptions|> to suppressed tokens (#1338)
* Fix: Prevent <|nocaptions|> tokens in BatchedInferencePipeline

- Add nocaptions component tokens [1771, 496, 9799] to suppress_tokens list
- Add segment filtering to remove any remaining <|nocaptions|> segments
- Resolves issue where BatchedInferencePipeline would generate malformed
  special tokens during periods of silence or low-confidence transcription
- Includes comprehensive tests to verify the fix

The issue occurred because while bracket tokens ('<', '|', '>') were
already suppressed, the content tokens ('no', 'ca', 'ptions') were not,
leading to partial token generation that formed complete <|nocaptions|>
tags in the output.

Files changed:
- faster_whisper/transcribe.py: Core fix implementation
- test_nocaptions_comprehensive.py: Comprehensive test suite
- tests/test_nocaptions_fix.py: Unit tests

* removed

* Fix: Prevent <|nocaptions|> tokens in BatchedInferencePipeline

* Fix: Implement proper <|nocaptions|> token suppression using single token approach

* ci: trigger tests

* fix: remove trailing whitespace from blank lines

* Update faster_whisper/transcribe.py

Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com>

* Update faster_whisper/tokenizer.py

Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com>

* Update faster_whisper/tokenizer.py

Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com>

* Rename no_speech to no_captions in tokenizer

* nocaptions has been renamed to nospeech

* break line

* line break

* Refactor no_speech method for improved readability by adjusting line breaks

---------

Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com>
2025-10-10 21:56:54 +03:00
Mahmoud Ashraf c26d609974 only merge when clip_timestamps are not provided (#1345)
fixes #1340 and allows for batching multiple audio files less than 30s each
2025-08-16 14:30:50 +03:00
黑墨水鱼 4bd98d5c5b Update README.md to include whisper-fastapi (#1325) 2025-08-11 13:44:48 +03:00
Mahmoud Ashraf 93001a9438 bump version to 1.2.0 v1.2.0 2025-08-06 03:31:36 +03:00
Mahmoud Ashraf a0c3cb9802 Remove Silence in Batched transcription (#1297) 2025-08-06 03:30:59 +03:00
Mahmoud Ashraf fbeb1ba731 get correct index for samples (#1336) 2025-08-06 03:17:45 +03:00
Rishil d3bfd0a305 feat: Allow loading of private HF models (#1309)
* feat: add HuggingFace auth token support to model download

* Format
2025-06-02 14:12:34 +03:00
Mahmoud Ashraf 43d4163fe0 Support distil-large-v3.5 (#1311) 2025-06-02 14:09:20 +03:00
Felix Mosheev 700584b2e6 feat: allow passing specific revision to download (#1292) 2025-04-30 00:55:48 +03:00
David Jiménez 1383fd4d37 Update README.md with speaches instead of faster-whisper-server (#1267)
Was previously named faster-whisper-server. They've decided to change the name from faster-whisper-server to speaches, as the project has evolved to support more than just ASR.
2025-03-20 17:20:26 +03:00
Mahmoud Ashraf 9e657b47cb Bump version to 1.1.1 v1.1.1 2025-01-01 17:44:54 +03:00
Purfview 11fd8ab301 Fix neg_threshold (#1191) 2024-12-29 14:38:58 +03:00
Dragoș BălanandMahmoudAshraf97 95164297ff Add duration of audio and VAD removed duration to BatchedInferencePipeline (#1186)
Co-authored-by: MahmoudAshraf97 <hassouna97.ma@gmail.com>
2024-12-23 17:23:40 +02:00
PurfviewandMahmoud Ashraf 1b24f284c9 Reduce VAD memory usage (#1198)
Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com>
2024-12-12 15:23:30 +03:00
Jordi Mas b568faec40 Add Open-dubbing into community projects (#1034)
* Add Open-dubbing into community projects

* Update URL
2024-12-12 13:36:04 +03:00
Purfview f32c0e8af3 Make batched suppress_tokens behaviour same as in sequential (#1194) 2024-12-11 14:51:38 +03:00
Purfview 8327d8cc64 Brings back original VAD parameters naming (#1181) 2024-12-01 20:41:53 +03:00
Mahmoud Ashraf 22a5238b56 Upgrade CI to 3.9 and drop Python 3.8 support(#1184) 2024-12-01 20:38:27 +03:00
Mahmoud Ashraf 97a4785fa1 Bump version to 1.1.0 and update benchmarks (#1161)
* update version

* Update CPU benchmarks

* Updated GPU benchmarks

* ..

* more gpu benchmarks
v1.1.0
2024-11-21 19:22:01 +03:00
Mahmoud Ashraf 08f6900217 remove log_prob_low_threshold (#1160) 2024-11-21 00:03:21 +03:00
Mahmoud Ashraf 9c8ef76c98 use jiwer instead of evaluate in benchmarks (#1159) 2024-11-20 23:51:55 +03:00
Mahmoud Ashraf 491852e1b9 Add new tests (#1158) 2024-11-20 14:50:57 +03:00
Mahmoud Ashraf f830c6f241 Fix list index out of range in word timestamps (#1157) 2024-11-20 13:36:58 +03:00
Mahmoud Ashraf bcd8ce0fc7 refactor multilingual option (#1148)
* Added test for `multilingual` option with english-german audio
* removed `output_language` argument as it is redundant, you can get the same functionality with `task="translate"`
* use the correct `encoder_output` for language detection in sequential transcription
* enabled `multilingual` functionality for batched inference
2024-11-20 00:14:59 +03:00
Mahmoud Ashraf be9fb36ed3 Cleanup of BatchedInferencePipeline (#1135) 2024-11-17 16:45:32 +03:00
Mahmoud Ashraf a6f8fbae00 Refactor of language detection functions (#1146)
* Supported new options for batched transcriptions:
  * `language_detection_threshold`
  * `language_detection_segments`
* Updated `WhisperModel.detect_language` function to include the improved language detection from #732  and added docstrings, it's now used inside `transcribe` function.
* Removed the following functions as they are no longer needed:
  * `WhisperModel.detect_language_multi_segment` and its test
  * `BatchedInferencePipeline.get_language_and_tokenizer`
* Added tests for empty audios
2024-11-16 13:53:07 +03:00
黑墨水鱼andMahmoud Ashraf 53bbe54016 fix: Use correct seek value in output, fix word timestamps when the initial timestamp is not zero (#1141)
Co-authored-by: Mahmoud Ashraf <hassouna97.ma@gmail.com>
2024-11-15 14:57:38 +03:00
Mahmoud Ashraf 85e61ea111 Add progress bar to WhisperModel.transcribe (#1138) 2024-11-14 17:12:39 +03:00
Mahmoud Ashraf 3e0ba86571 Remove torch dependency, Faster numpy Feature extraction (#1106) 2024-11-14 12:57:10 +03:00