Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server): Add option to suppress non-speech tokens #2649

Merged

Conversation

sachaarbonel
Copy link
Contributor

@sachaarbonel sachaarbonel commented Dec 20, 2024

This PR adds the ability to suppress non-speech tokens in the whisper transcription output. Users can enable this feature through:

  • CLI flag: -sns or --suppress-non-speech
  • HTTP request parameter: suppress_non_speech

This feature is useful for obtaining cleaner transcriptions by removing non-speech markers (like [LAUGH], [SIGH], etc.) from the output text.

@sachaarbonel sachaarbonel changed the title Add support for non-speech token suppression feat: Add option to suppress non-speech tokens in server Dec 20, 2024
@sachaarbonel sachaarbonel changed the title feat: Add option to suppress non-speech tokens in server feat: Add option to suppress non-speech tokens in server example Dec 20, 2024
@sachaarbonel sachaarbonel changed the title feat: Add option to suppress non-speech tokens in server example feat(server): Add option to suppress non-speech tokens Dec 20, 2024
@ggerganov ggerganov merged commit 944ce49 into ggerganov:master Dec 21, 2024
bygreencn added a commit to bygreencn/whisper.cpp that referenced this pull request Dec 26, 2024
* ggerganov/master: (49 commits)
  cli : add --suppress_nst support (ggerganov#2664)
  cli : add no_speech_thold (ggerganov#2663)
  cmake : remove hardcoded install rpath
  server : fix help print
  ruby : bug fix on callbacks and no_speech_prob (ggerganov#2656)
  server : add no-speech threshold parameter and functionality (ggerganov#2654)
  whisper : rename suppress_non_speech_tokens to suppress_nst (ggerganov#2653)
  server : add option to suppress non-speech tokens (ggerganov#2649)
  whisper : rename binaries + fix install (ggerganov#2648)
  ruby : update gem version to v1.3.1
  release : v1.7.3
  ci : msys enable SDL2 build (ggerganov#2635)
  ruby : sync ggml (ggerganov#2643)
  android : try to fix build
  files : remove old sources
  sync : ggml
  talk-llama : sync llama.cpp
  sync : ggml
  ggml : update ggml_backend_cpu_device_supports_op (llama/10867)
  vulkan: bugfixes for small subgroup size systems + llvmpipe test (llama/10809)
  ...
lyapple2008 pushed a commit to lyapple2008/whisper.cpp.mars that referenced this pull request Feb 4, 2025
* The parameter will suppress non-speech tokens like [LAUGH], [SIGH], etc. from the output when enabled.

* add to whisper_params_parse

* add missing param
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.

2 participants