diff --git a/DESCRIPTION b/DESCRIPTION index 2b2c97d..3230072 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 - diff --git a/R/whisper.R b/R/whisper.R index 58ba1ed..728f06b 100644 --- a/R/whisper.R +++ b/R/whisper.R @@ -237,12 +237,18 @@ align_skipped <- function(sentences, skipped, from = "from", to = "to"){ #' language = "en", duration = 1000) #' } whisper <- function(x, use_gpu = 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", - "small-q5_1", "small.en-q5_1", - "medium-q5_0", "medium.en-q5_0", - "large-v2-q5_0", "large-v3-q5_0")){ + if(x %in% c("tiny", "tiny-q5_1", "tiny-q8_0", + "tiny.en", "tiny.en-q5_1", "tiny.en-q8_0", + "base", "base-q5_1", "base-q8_0", + "base.en", "base.en-q5_1", "base.en-q8_0", + "small", "small-q5_1", "small-q8_0", + "small.en", "small.en-q5_1", "small.en-q8_0", + "medium", "medium-q5_0", "medium-q8_0", + "medium.en", "medium.en-q5_0", "medium.en-q8_0", + "large-v1", + "large-v2", "large-v2-q5_0", "large-v2-q8_0", + "large-v3", "large-v3-q5_0", + "large-v3-turbo", "large-v3-turbo-q5_0", "large-v3-turbo-q8_0")){ x <- whisper_download_model(x, overwrite = overwrite, model_dir = model_dir) } if(inherits(x, "whisper_download")){ @@ -263,8 +269,8 @@ whisper <- function(x, use_gpu = FALSE, overwrite = FALSE, model_dir = Sys.geten #' \item{base & base.en: 142 MB, RAM required: ~500 MB. Multilingual and English only version.} #' \item{small & small.en: 466 MB, RAM required: ~1.0 GB. Multilingual and English only version.} #' \item{medium & medium.en: 1.5 GB, RAM required: ~2.6 GB. Multilingual and English only version.} -#' \item{large-v1, large-v2, large-v3: 2.9 GB, RAM required: ~4.7 GB. Multilingual} -#' \item{quantised models: tiny-q5_1, tiny.en-q5_1, base-q5_1, base.en-q5_1, small-q5_1, small.en-q5_1, medium-q5_0, medium.en-q5_0, large-v2-q5_0 and large-v3-q5_0 (only - from version 1.5.4 onwards)} +#' \item{large-v1, large-v2, large-v3, large-v3-turbo: 2.9 GB, RAM required: ~4.7 GB. Multilingual} +#' \item{quantised models: tiny-q5_1, tiny-q8_0, tiny.en-q5_1, tiny.en-q8_0, base-q5_1, base-q8_0, base.en-q5_1, base_q8_0, small-q5_1, small-q8_0, small.en-q5_1, small.en-q8_0, medium-q5_0, medium-q8_0, medium.en-q5_0, medium.en-q8_0, large-v2-q5_0, large-v2-q8_0, large-v3-q5_0, large-v3-turbo-q5_0, and large-v3-turbo-q8_0 (only - from version 1.5.4 onwards)} #' } #' Note that the larger models may take longer than 60 seconds to download, so consider #' increasing the timeout option in R via \code{options(timeout = 120)} @@ -314,12 +320,18 @@ whisper <- function(x, use_gpu = FALSE, overwrite = FALSE, model_dir = Sys.geten #' \dontshow{ #' if(file.exists(path$file_model)) file.remove(path$file_model) #' } -whisper_download_model <- function(x = 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", - "small-q5_1", "small.en-q5_1", - "medium-q5_0", "medium.en-q5_0", - "large-v2-q5_0", "large-v3-q5_0"), +whisper_download_model <- function(x = c("tiny", "tiny-q5_1", "tiny-q8_0", + "tiny.en", "tiny.en-q5_1", "tiny.en-q8_0", + "base", "base-q5_1", "base-q8_0", + "base.en", "base.en-q5_1", "base.en-q8_0", + "small", "small-q5_1", "small-q8_0", + "small.en", "small.en-q5_1", "small.en-q8_0", + "medium", "medium-q5_0", "medium-q8_0", + "medium.en", "medium.en-q5_0", "medium.en-q8_0", + "large-v1", + "large-v2", "large-v2-q5_0", "large-v2-q8_0", + "large-v3", "large-v3-q5_0", + "large-v3-turbo", "large-v3-turbo-q5_0", "large-v3-turbo-q8_0"), model_dir = Sys.getenv("WHISPER_MODEL_DIR", unset = getwd()), repos = c("huggingface", "ggerganov"), version = c("1.5.4", "1.2.1"), diff --git a/man/whisper_download_model.Rd b/man/whisper_download_model.Rd index 13cfde5..80e0da0 100644 --- a/man/whisper_download_model.Rd +++ b/man/whisper_download_model.Rd @@ -5,10 +5,12 @@ \title{Download a pretrained Whisper model} \usage{ whisper_download_model( - x = 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", "small-q5_1", "small.en-q5_1", - "medium-q5_0", "medium.en-q5_0", "large-v2-q5_0", "large-v3-q5_0"), + x = c("tiny", "tiny-q5_1", "tiny-q8_0", "tiny.en", "tiny.en-q5_1", "tiny.en-q8_0", + "base", "base-q5_1", "base-q8_0", "base.en", "base.en-q5_1", "base.en-q8_0", "small", + "small-q5_1", "small-q8_0", "small.en", "small.en-q5_1", "small.en-q8_0", "medium", + "medium-q5_0", "medium-q8_0", "medium.en", "medium.en-q5_0", "medium.en-q8_0", + "large-v1", "large-v2", "large-v2-q5_0", "large-v2-q8_0", "large-v3", + "large-v3-q5_0", "large-v3-turbo", "large-v3-turbo-q5_0", "large-v3-turbo-q8_0"), model_dir = Sys.getenv("WHISPER_MODEL_DIR", unset = getwd()), repos = c("huggingface", "ggerganov"), version = c("1.5.4", "1.2.1"), @@ -52,8 +54,8 @@ Download a pretrained Whisper model. The list of available models are \item{base & base.en: 142 MB, RAM required: ~500 MB. Multilingual and English only version.} \item{small & small.en: 466 MB, RAM required: ~1.0 GB. Multilingual and English only version.} \item{medium & medium.en: 1.5 GB, RAM required: ~2.6 GB. Multilingual and English only version.} -\item{large-v1, large-v2, large-v3: 2.9 GB, RAM required: ~4.7 GB. Multilingual} -\item{quantised models: tiny-q5_1, tiny.en-q5_1, base-q5_1, base.en-q5_1, small-q5_1, small.en-q5_1, medium-q5_0, medium.en-q5_0, large-v2-q5_0 and large-v3-q5_0 (only - from version 1.5.4 onwards)} +\item{large-v1, large-v2, large-v3, large-v3-turbo: 2.9 GB, RAM required: ~4.7 GB. Multilingual} +\item{quantised models: tiny-q5_1, tiny-q8_0, tiny.en-q5_1, tiny.en-q8_0, base-q5_1, base-q8_0, base.en-q5_1, base_q8_0, small-q5_1, small-q8_0, small.en-q5_1, small.en-q8_0, medium-q5_0, medium-q8_0, medium.en-q5_0, medium.en-q8_0, large-v2-q5_0, large-v2-q8_0, large-v3-q5_0, large-v3-turbo-q5_0, and large-v3-turbo-q8_0 (only - from version 1.5.4 onwards)} } Note that the larger models may take longer than 60 seconds to download, so consider increasing the timeout option in R via \code{options(timeout = 120)} diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 5bb9bf5..cf534fa 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -5,6 +5,11 @@ using namespace Rcpp; +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + // whisper_load_model SEXP whisper_load_model(std::string model, bool use_gpu); RcppExport SEXP _audio_whisper_whisper_load_model(SEXP modelSEXP, SEXP use_gpuSEXP) {