refactor: remove deprecated fn
This commit is contained in:
parent
e316c08f14
commit
85edf85e5f
2 changed files with 0 additions and 36 deletions
|
|
@ -70,27 +70,6 @@ impl WhisperInnerContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new WhisperContext from a buffer.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
/// * buffer: The buffer containing the model.
|
|
||||||
///
|
|
||||||
/// # Returns
|
|
||||||
/// Ok(Self) on success, Err(WhisperError) on failure.
|
|
||||||
///
|
|
||||||
/// # C++ equivalent
|
|
||||||
/// `struct whisper_context * whisper_init_from_buffer_no_state(void * buffer, size_t buffer_size)`
|
|
||||||
#[deprecated = "Use `new_from_buffer_with_params` instead"]
|
|
||||||
pub fn new_from_buffer(buffer: &[u8]) -> Result<Self, WhisperError> {
|
|
||||||
let ctx = unsafe {
|
|
||||||
whisper_rs_sys::whisper_init_from_buffer_no_state(buffer.as_ptr() as _, buffer.len())
|
|
||||||
};
|
|
||||||
if ctx.is_null() {
|
|
||||||
Err(WhisperError::InitError)
|
|
||||||
} else {
|
|
||||||
Ok(Self { ctx })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Convert the provided text into tokens.
|
/// Convert the provided text into tokens.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -51,21 +51,6 @@ impl WhisperContext {
|
||||||
Ok(Self::wrap(ctx))
|
Ok(Self::wrap(ctx))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new WhisperContext from a buffer.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
/// * buffer: The buffer containing the model.
|
|
||||||
///
|
|
||||||
/// # Returns
|
|
||||||
/// Ok(Self) on success, Err(WhisperError) on failure.
|
|
||||||
///
|
|
||||||
/// # C++ equivalent
|
|
||||||
/// `struct whisper_context * whisper_init_from_buffer_no_state(void * buffer, size_t buffer_size)`
|
|
||||||
#[deprecated = "Use `new_from_buffer_with_params` instead"]
|
|
||||||
pub fn new_from_buffer(buffer: &[u8]) -> Result<Self, WhisperError> {
|
|
||||||
let ctx = WhisperInnerContext::new_from_buffer(buffer)?;
|
|
||||||
Ok(Self::wrap(ctx))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Convert the provided text into tokens.
|
/// Convert the provided text into tokens.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue