diff --git a/src/whisper_ctx.rs b/src/whisper_ctx.rs index 1520f7a..d1c4a50 100644 --- a/src/whisper_ctx.rs +++ b/src/whisper_ctx.rs @@ -1,5 +1,4 @@ use crate::error::WhisperError; -use crate::whisper_state::WhisperState; use crate::WhisperToken; use std::ffi::{c_int, CStr, CString}; @@ -71,27 +70,6 @@ impl WhisperInnerContext { } } - /// Create a new WhisperContext from a file. - /// - /// # Arguments - /// * path: The path to the model file. - /// - /// # Returns - /// Ok(Self) on success, Err(WhisperError) on failure. - /// - /// # C++ equivalent - /// `struct whisper_context * whisper_init_from_file_no_state(const char * path_model)` - #[deprecated = "Use `new_with_params` instead"] - pub fn new(path: &str) -> Result { - let path_cstr = CString::new(path)?; - let ctx = unsafe { whisper_rs_sys::whisper_init_from_file_no_state(path_cstr.as_ptr()) }; - if ctx.is_null() { - Err(WhisperError::InitError) - } else { - Ok(Self { ctx }) - } - } - /// Create a new WhisperContext from a buffer. /// /// # Arguments diff --git a/src/whisper_ctx_wrapper.rs b/src/whisper_ctx_wrapper.rs index 04ecfcb..cff0237 100644 --- a/src/whisper_ctx_wrapper.rs +++ b/src/whisper_ctx_wrapper.rs @@ -51,22 +51,6 @@ impl WhisperContext { Ok(Self::wrap(ctx)) } - /// Create a new WhisperContext from a file. - /// - /// # Arguments - /// * path: The path to the model file. - /// - /// # Returns - /// Ok(Self) on success, Err(WhisperError) on failure. - /// - /// # C++ equivalent - /// `struct whisper_context * whisper_init_from_file_no_state(const char * path_model)` - #[deprecated = "Use `new_with_params` instead"] - pub fn new(path: &str) -> Result { - let ctx = WhisperInnerContext::new(path)?; - Ok(Self::wrap(ctx)) - } - /// Create a new WhisperContext from a buffer. /// /// # Arguments