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

Upgrade to v1.7.0 #71

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ddd05dd
NEWS / DESCRIPTION
jwijffels Oct 2, 2024
e3bf37f
Delete current src folder
jwijffels Oct 2, 2024
25f7a7e
add whisper.cpp git snapshot commit ede1718f6d45aa3f7ad4a1e169dfbc9d5…
jwijffels Oct 2, 2024
a963a7c
log sha
jwijffels Oct 2, 2024
c001259
replace Makevars with current whisper.cpp Makefile
jwijffels Oct 2, 2024
d38e7e4
add whisper.cpp examples (main/bench/server/command) as a reference
jwijffels Oct 2, 2024
ca40b1e
bump roxygen
jwijffels Oct 2, 2024
740634d
try to compile
jwijffels Oct 2, 2024
7c5ba59
trying to compile
jwijffels Oct 2, 2024
b163116
trying to compile
jwijffels Oct 2, 2024
5d919d1
try to compile
jwijffels Oct 2, 2024
95f7fde
Update whisper.cpp to 1.7.0
jwijffels Oct 6, 2024
3435bbe
NEWS
jwijffels Oct 6, 2024
8b8313c
WIP
jwijffels Oct 6, 2024
b516273
move non-whisper.cpp to rcpp_whisper_utils
jwijffels Oct 6, 2024
3df3060
add code from main in rcpp_whisper.cpp
jwijffels Oct 6, 2024
f24288b
remove all the output_ functionalities from whisper.cpp
jwijffels Oct 6, 2024
002a59e
include latest makefiles from whisper.cpp 1.7.0
jwijffels Oct 6, 2024
4c9c207
nothing
jwijffels Oct 6, 2024
21d8f9c
remove output_csv
jwijffels Oct 6, 2024
80a95c8
add grammar-parser + common in compilation
jwijffels Oct 6, 2024
5a9215d
Add WhisperModel and whisper_load_model
jwijffels Oct 6, 2024
685d37f
whisper_print_progress_callback + whisper_print_segment_callback to w…
jwijffels Oct 6, 2024
3c85dbc
add whisper_load_model to Rcpp
jwijffels Oct 6, 2024
4b3c01c
move to_timestamp, timestamp_to_sample to rcpp_whisper again in order…
jwijffels Oct 6, 2024
c71c725
move whisper_print_benchmark to whisper_utils
jwijffels Oct 6, 2024
a42be1d
move whisper_print_benchmark to rcpp_whisper again
jwijffels Oct 6, 2024
6beee2b
incluce Rcpp.h
jwijffels Oct 6, 2024
e97ae4d
add whisper_print_benchmark to RcppExports
jwijffels Oct 6, 2024
fa2ae97
move Whispermodel and whisper_load_model ot rcpp_whisper.cpp
jwijffels Oct 6, 2024
25473f2
put whisper_encode back in it's original form, disable main from whis…
jwijffels Oct 6, 2024
d44884a
move whisper_load_model again to main cpp code, make sure in estimate…
jwijffels Oct 6, 2024
2c24bbc
take to_timestamp and timestamp_to_sample from common
jwijffels Oct 6, 2024
208f5d0
add flash_attn,
jwijffels Oct 7, 2024
575bf74
Add flash attention
jwijffels Oct 7, 2024
0046ba7
rcppexports add flash attention
jwijffels Oct 7, 2024
91f8f56
no dtw
jwijffels Oct 7, 2024
4950b0f
NEWS
jwijffels Oct 7, 2024
94e4ca0
remove unneccesary common/json code in examples
jwijffels Oct 7, 2024
a20a31b
remove examples/command, examples/server
jwijffels Oct 8, 2024
1cacb04
Makevars (1)
jwijffels Oct 8, 2024
6fc7f05
Makevars (2)
jwijffels Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: audio.whisper
Type: Package
Title: Transcribe Audio Files using the "Whisper" Automatic Speech Recognition Model
Version: 0.4.1
Version: 0.5.0
Maintainer: Jan Wijffels <[email protected]>
Authors@R: c(
person('Jan', 'Wijffels', role = c('aut', 'cre', 'cph'), email = '[email protected]', comment = "R wrapper"),
Expand Down Expand Up @@ -29,6 +29,5 @@ Suggests:
audio.vadwebrtc (>= 0.2.0)
LinkingTo: Rcpp
SystemRequirements: GNU make
RoxygenNote: 7.1.2
RoxygenNote: 7.3.2
Remotes: bnosac/audio.vadwebrtc

5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## CHANGES IN audio.whisper VERSION 0.5.0

- Upgrade to whisper.cpp version v1.7.0
- Enable flash attention

## CHANGES IN audio.whisper VERSION 0.4.1

- Added function predict.whisper_transcription which allows to assign a transcription segment to either a left/right channel based on a Voice Activity Detection
Expand Down
4 changes: 2 additions & 2 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

whisper_load_model <- function(model, use_gpu = FALSE) {
.Call('_audio_whisper_whisper_load_model', PACKAGE = 'audio.whisper', model, use_gpu)
whisper_load_model <- function(model, use_gpu = FALSE, flash_attn = FALSE) {
.Call('_audio_whisper_whisper_load_model', PACKAGE = 'audio.whisper', model, use_gpu, flash_attn)
}

whisper_encode <- function(model, path, language, token_timestamps = FALSE, translate = FALSE, duration = 0L, offset = 0L, trace = 1L, n_threads = 1L, n_processors = 1L, entropy_thold = 2.40, logprob_thold = -1.00, beam_size = -1L, best_of = 5L, split_on_word = FALSE, max_context = -1L, prompt = "", print_special = FALSE, diarize = FALSE, diarize_percent = 1.1) {
Expand Down
5 changes: 3 additions & 2 deletions R/whisper.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ align_skipped <- function(sentences, skipped, from = "from", to = "to"){
#' @param x the path to a model, an object returned by \code{\link{whisper_download_model}} or a character string with
#' the name of the model which can be passed on to \code{\link{whisper_download_model}}
#' @param use_gpu logical indicating to use the GPU in case you have Metal or an NVIDIA GPU. Defaults to \code{FALSE}.
#' @param flash_attn logical indicating to use flash attention. Defaults to \code{FALSE}.
#' @param overwrite logical indicating to overwrite the model file if the model file was already downloaded, passed on to \code{\link{whisper_download_model}}. Defaults to \code{FALSE}.
#' @param model_dir a path where the model will be downloaded to, passed on to \code{\link{whisper_download_model}}.
#' Defaults to the environment variable \code{WHISPER_MODEL_DIR} and if this is not set, the current working directory
Expand Down Expand Up @@ -236,7 +237,7 @@ align_skipped <- function(sentences, skipped, from = "from", to = "to"){
#' trans <- predict(model, newdata = system.file(package = "audio.whisper", "samples", "jfk.wav"),
#' language = "en", duration = 1000)
#' }
whisper <- function(x, use_gpu = FALSE, overwrite = FALSE, model_dir = Sys.getenv("WHISPER_MODEL_DIR", unset = getwd()), ...){
whisper <- function(x, use_gpu = FALSE, flash_attn = FALSE, overwrite = FALSE, model_dir = Sys.getenv("WHISPER_MODEL_DIR", unset = getwd()), ...){
if(x %in% c("tiny", "tiny.en", "base", "base.en", "small", "small.en", "medium", "medium.en", "large-v1", "large-v2", "large-v3", "large",
"tiny-q5_1", "tiny.en-q5_1",
"base-q5_1", "base.en-q5_1",
Expand All @@ -251,7 +252,7 @@ whisper <- function(x, use_gpu = FALSE, overwrite = FALSE, model_dir = Sys.geten
out <- list(file = x)
}
Sys.setenv("GGML_METAL_PATH_RESOURCES" = Sys.getenv("GGML_METAL_PATH_RESOURCES", unset = system.file(package = "audio.whisper", "metal")))
out$model <- whisper_load_model(out$file, use_gpu = use_gpu, ...)
out$model <- whisper_load_model(out$file, use_gpu = use_gpu, flash_attn = flash_attn, ...)
class(out) <- "whisper"
out
}
Expand Down
3 changes: 3 additions & 0 deletions man/whisper.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/whisper_download_model.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading