update bindings

This commit is contained in:
Zero 2023-04-17 15:56:30 -06:00
parent 400d03fd2a
commit 1d7d5bade4
No known key found for this signature in database
GPG key ID: 3861E636EA1E0E2B

View file

@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.61.0 */ /* automatically generated by rust-bindgen 0.65.1 */
pub const _STDINT_H: u32 = 1; pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1; pub const _FEATURES_H: u32 = 1;
@ -17,6 +17,10 @@ pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1; pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1; pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1; pub const _ATFILE_SOURCE: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const __TIMESIZE: u32 = 64;
pub const __USE_MISC: u32 = 1; pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1; pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __USE_FORTIFY_LEVEL: u32 = 0;
@ -24,31 +28,31 @@ pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1; pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_60559_BFP__: u32 = 201404;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1; pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
pub const __STDC_ISO_10646__: u32 = 201706; pub const __STDC_ISO_10646__: u32 = 201706;
pub const __GNU_LIBRARY__: u32 = 6; pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2; pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 31; pub const __GLIBC_MINOR__: u32 = 37;
pub const _SYS_CDEFS_H: u32 = 1; pub const _SYS_CDEFS_H: u32 = 1;
pub const __glibc_c99_flexarr_available: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1;
pub const __WORDSIZE: u32 = 64; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const __LONG_DOUBLE_USES_FLOAT128: u32 = 0;
pub const __HAVE_GENERIC_SELECTION: u32 = 1; pub const __HAVE_GENERIC_SELECTION: u32 = 1;
pub const __GLIBC_USE_LIB_EXT2: u32 = 0; pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
pub const _BITS_TYPES_H: u32 = 1; pub const _BITS_TYPES_H: u32 = 1;
pub const __TIMESIZE: u32 = 64;
pub const _BITS_TYPESIZES_H: u32 = 1; pub const _BITS_TYPESIZES_H: u32 = 1;
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
pub const __INO_T_MATCHES_INO64_T: u32 = 1; pub const __INO_T_MATCHES_INO64_T: u32 = 1;
pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
pub const __STATFS_MATCHES_STATFS64: u32 = 1; pub const __STATFS_MATCHES_STATFS64: u32 = 1;
pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
pub const __FD_SETSIZE: u32 = 1024; pub const __FD_SETSIZE: u32 = 1024;
pub const _BITS_TIME64_H: u32 = 1; pub const _BITS_TIME64_H: u32 = 1;
pub const _BITS_WCHAR_H: u32 = 1; pub const _BITS_WCHAR_H: u32 = 1;
@ -91,9 +95,9 @@ pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1; pub const SIZE_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0; pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295; pub const WINT_MAX: u32 = 4294967295;
pub const __bool_true_false_are_defined: u32 = 1;
pub const true_: u32 = 1; pub const true_: u32 = 1;
pub const false_: u32 = 0; pub const false_: u32 = 0;
pub const __bool_true_false_are_defined: u32 = 1;
pub const WHISPER_SAMPLE_RATE: u32 = 16000; pub const WHISPER_SAMPLE_RATE: u32 = 16000;
pub const WHISPER_N_FFT: u32 = 400; pub const WHISPER_N_FFT: u32 = 400;
pub const WHISPER_N_MEL: u32 = 80; pub const WHISPER_N_MEL: u32 = 80;
@ -214,6 +218,7 @@ pub type __id_t = ::std::os::raw::c_uint;
pub type __time_t = ::std::os::raw::c_long; pub type __time_t = ::std::os::raw::c_long;
pub type __useconds_t = ::std::os::raw::c_uint; pub type __useconds_t = ::std::os::raw::c_uint;
pub type __suseconds_t = ::std::os::raw::c_long; pub type __suseconds_t = ::std::os::raw::c_long;
pub type __suseconds64_t = ::std::os::raw::c_long;
pub type __daddr_t = ::std::os::raw::c_int; pub type __daddr_t = ::std::os::raw::c_int;
pub type __key_t = ::std::os::raw::c_int; pub type __key_t = ::std::os::raw::c_int;
pub type __clockid_t = ::std::os::raw::c_int; pub type __clockid_t = ::std::os::raw::c_int;
@ -257,6 +262,11 @@ pub type uintmax_t = __uintmax_t;
pub struct whisper_context { pub struct whisper_context {
_unused: [u8; 0], _unused: [u8; 0],
} }
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct whisper_state {
_unused: [u8; 0],
}
pub type whisper_token = ::std::os::raw::c_int; pub type whisper_token = ::std::os::raw::c_int;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
@ -459,9 +469,29 @@ extern "C" {
extern "C" { extern "C" {
pub fn whisper_init(loader: *mut whisper_model_loader) -> *mut whisper_context; pub fn whisper_init(loader: *mut whisper_model_loader) -> *mut whisper_context;
} }
extern "C" {
pub fn whisper_init_from_file_no_state(
path_model: *const ::std::os::raw::c_char,
) -> *mut whisper_context;
}
extern "C" {
pub fn whisper_init_from_buffer_no_state(
buffer: *mut ::std::os::raw::c_void,
buffer_size: usize,
) -> *mut whisper_context;
}
extern "C" {
pub fn whisper_init_no_state(loader: *mut whisper_model_loader) -> *mut whisper_context;
}
extern "C" {
pub fn whisper_init_state(ctx: *mut whisper_context) -> *mut whisper_state;
}
extern "C" { extern "C" {
pub fn whisper_free(ctx: *mut whisper_context); pub fn whisper_free(ctx: *mut whisper_context);
} }
extern "C" {
pub fn whisper_free_state(state: *mut whisper_state);
}
extern "C" { extern "C" {
pub fn whisper_pcm_to_mel( pub fn whisper_pcm_to_mel(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -470,6 +500,32 @@ extern "C" {
n_threads: ::std::os::raw::c_int, n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_pcm_to_mel_with_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
samples: *const f32,
n_samples: ::std::os::raw::c_int,
n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_pcm_to_mel_phase_vocoder(
ctx: *mut whisper_context,
samples: *const f32,
n_samples: ::std::os::raw::c_int,
n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_pcm_to_mel_phase_vocoder_with_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
samples: *const f32,
n_samples: ::std::os::raw::c_int,
n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_set_mel( pub fn whisper_set_mel(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -478,6 +534,15 @@ extern "C" {
n_mel: ::std::os::raw::c_int, n_mel: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_set_mel_with_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
data: *const f32,
n_len: ::std::os::raw::c_int,
n_mel: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_encode( pub fn whisper_encode(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -485,6 +550,14 @@ extern "C" {
n_threads: ::std::os::raw::c_int, n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_encode_with_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
offset: ::std::os::raw::c_int,
n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_decode( pub fn whisper_decode(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -494,6 +567,16 @@ extern "C" {
n_threads: ::std::os::raw::c_int, n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_decode_with_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
tokens: *const whisper_token,
n_tokens: ::std::os::raw::c_int,
n_past: ::std::os::raw::c_int,
n_threads: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_tokenize( pub fn whisper_tokenize(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -519,9 +602,21 @@ extern "C" {
lang_probs: *mut f32, lang_probs: *mut f32,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_lang_auto_detect_with_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
offset_ms: ::std::os::raw::c_int,
n_threads: ::std::os::raw::c_int,
lang_probs: *mut f32,
) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_n_len(ctx: *mut whisper_context) -> ::std::os::raw::c_int; pub fn whisper_n_len(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_n_len_from_state(state: *mut whisper_state) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_n_vocab(ctx: *mut whisper_context) -> ::std::os::raw::c_int; pub fn whisper_n_vocab(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
} }
@ -534,15 +629,57 @@ extern "C" {
extern "C" { extern "C" {
pub fn whisper_is_multilingual(ctx: *mut whisper_context) -> ::std::os::raw::c_int; pub fn whisper_is_multilingual(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_model_n_vocab(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_audio_ctx(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_audio_state(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_audio_head(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_audio_layer(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_text_ctx(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_text_state(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_text_head(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_text_layer(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_n_mels(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_f16(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_model_type(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_get_logits(ctx: *mut whisper_context) -> *mut f32; pub fn whisper_get_logits(ctx: *mut whisper_context) -> *mut f32;
} }
extern "C" {
pub fn whisper_get_logits_from_state(state: *mut whisper_state) -> *mut f32;
}
extern "C" { extern "C" {
pub fn whisper_token_to_str( pub fn whisper_token_to_str(
ctx: *mut whisper_context, ctx: *mut whisper_context,
token: whisper_token, token: whisper_token,
) -> *const ::std::os::raw::c_char; ) -> *const ::std::os::raw::c_char;
} }
extern "C" {
pub fn whisper_model_type_readable(ctx: *mut whisper_context) -> *const ::std::os::raw::c_char;
}
extern "C" { extern "C" {
pub fn whisper_token_eot(ctx: *mut whisper_context) -> whisper_token; pub fn whisper_token_eot(ctx: *mut whisper_context) -> whisper_token;
} }
@ -584,17 +721,39 @@ extern "C" {
} }
pub const whisper_sampling_strategy_WHISPER_SAMPLING_GREEDY: whisper_sampling_strategy = 0; pub const whisper_sampling_strategy_WHISPER_SAMPLING_GREEDY: whisper_sampling_strategy = 0;
pub const whisper_sampling_strategy_WHISPER_SAMPLING_BEAM_SEARCH: whisper_sampling_strategy = 1; pub const whisper_sampling_strategy_WHISPER_SAMPLING_BEAM_SEARCH: whisper_sampling_strategy = 1;
#[doc = ""]
pub type whisper_sampling_strategy = ::std::os::raw::c_uint; pub type whisper_sampling_strategy = ::std::os::raw::c_uint;
pub type whisper_new_segment_callback = ::std::option::Option< pub type whisper_new_segment_callback = ::std::option::Option<
unsafe extern "C" fn( unsafe extern "C" fn(
ctx: *mut whisper_context, ctx: *mut whisper_context,
state: *mut whisper_state,
n_new: ::std::os::raw::c_int, n_new: ::std::os::raw::c_int,
user_data: *mut ::std::os::raw::c_void, user_data: *mut ::std::os::raw::c_void,
), ),
>; >;
pub type whisper_progress_callback = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut whisper_context,
state: *mut whisper_state,
progress: ::std::os::raw::c_int,
user_data: *mut ::std::os::raw::c_void,
),
>;
pub type whisper_encoder_begin_callback = ::std::option::Option< pub type whisper_encoder_begin_callback = ::std::option::Option<
unsafe extern "C" fn(ctx: *mut whisper_context, user_data: *mut ::std::os::raw::c_void) -> bool, unsafe extern "C" fn(
ctx: *mut whisper_context,
state: *mut whisper_state,
user_data: *mut ::std::os::raw::c_void,
) -> bool,
>;
pub type whisper_logits_filter_callback = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut whisper_context,
state: *mut whisper_state,
tokens: *const whisper_token_data,
n_tokens: ::std::os::raw::c_int,
logits: *mut f32,
user_data: *mut ::std::os::raw::c_void,
),
>; >;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
@ -615,13 +774,16 @@ pub struct whisper_full_params {
pub thold_pt: f32, pub thold_pt: f32,
pub thold_ptsum: f32, pub thold_ptsum: f32,
pub max_len: ::std::os::raw::c_int, pub max_len: ::std::os::raw::c_int,
pub split_on_word: bool,
pub max_tokens: ::std::os::raw::c_int, pub max_tokens: ::std::os::raw::c_int,
pub speed_up: bool, pub speed_up: bool,
pub audio_ctx: ::std::os::raw::c_int, pub audio_ctx: ::std::os::raw::c_int,
pub initial_prompt: *const ::std::os::raw::c_char,
pub prompt_tokens: *const whisper_token, pub prompt_tokens: *const whisper_token,
pub prompt_n_tokens: ::std::os::raw::c_int, pub prompt_n_tokens: ::std::os::raw::c_int,
pub language: *const ::std::os::raw::c_char, pub language: *const ::std::os::raw::c_char,
pub suppress_blank: bool, pub suppress_blank: bool,
pub suppress_non_speech_tokens: bool,
pub temperature: f32, pub temperature: f32,
pub max_initial_ts: f32, pub max_initial_ts: f32,
pub length_penalty: f32, pub length_penalty: f32,
@ -633,8 +795,12 @@ pub struct whisper_full_params {
pub beam_search: whisper_full_params__bindgen_ty_2, pub beam_search: whisper_full_params__bindgen_ty_2,
pub new_segment_callback: whisper_new_segment_callback, pub new_segment_callback: whisper_new_segment_callback,
pub new_segment_callback_user_data: *mut ::std::os::raw::c_void, pub new_segment_callback_user_data: *mut ::std::os::raw::c_void,
pub progress_callback: whisper_progress_callback,
pub progress_callback_user_data: *mut ::std::os::raw::c_void,
pub encoder_begin_callback: whisper_encoder_begin_callback, pub encoder_begin_callback: whisper_encoder_begin_callback,
pub encoder_begin_callback_user_data: *mut ::std::os::raw::c_void, pub encoder_begin_callback_user_data: *mut ::std::os::raw::c_void,
pub logits_filter_callback: whisper_logits_filter_callback,
pub logits_filter_callback_user_data: *mut ::std::os::raw::c_void,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
@ -721,7 +887,7 @@ fn bindgen_test_layout_whisper_full_params() {
let ptr = UNINIT.as_ptr(); let ptr = UNINIT.as_ptr();
assert_eq!( assert_eq!(
::std::mem::size_of::<whisper_full_params>(), ::std::mem::size_of::<whisper_full_params>(),
160usize, 200usize,
concat!("Size of: ", stringify!(whisper_full_params)) concat!("Size of: ", stringify!(whisper_full_params))
); );
assert_eq!( assert_eq!(
@ -890,8 +1056,18 @@ fn bindgen_test_layout_whisper_full_params() {
) )
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_tokens) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).split_on_word) as usize - ptr as usize },
40usize, 40usize,
concat!(
"Offset of field: ",
stringify!(whisper_full_params),
"::",
stringify!(split_on_word)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_tokens) as usize - ptr as usize },
44usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -901,7 +1077,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).speed_up) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).speed_up) as usize - ptr as usize },
44usize, 48usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -911,7 +1087,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).audio_ctx) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).audio_ctx) as usize - ptr as usize },
48usize, 52usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -920,8 +1096,18 @@ fn bindgen_test_layout_whisper_full_params() {
) )
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).prompt_tokens) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).initial_prompt) as usize - ptr as usize },
56usize, 56usize,
concat!(
"Offset of field: ",
stringify!(whisper_full_params),
"::",
stringify!(initial_prompt)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).prompt_tokens) as usize - ptr as usize },
64usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -931,7 +1117,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).prompt_n_tokens) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).prompt_n_tokens) as usize - ptr as usize },
64usize, 72usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -941,7 +1127,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).language) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).language) as usize - ptr as usize },
72usize, 80usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -951,7 +1137,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).suppress_blank) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).suppress_blank) as usize - ptr as usize },
80usize, 88usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -959,9 +1145,19 @@ fn bindgen_test_layout_whisper_full_params() {
stringify!(suppress_blank) stringify!(suppress_blank)
) )
); );
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).suppress_non_speech_tokens) as usize - ptr as usize },
89usize,
concat!(
"Offset of field: ",
stringify!(whisper_full_params),
"::",
stringify!(suppress_non_speech_tokens)
)
);
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).temperature) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).temperature) as usize - ptr as usize },
84usize, 92usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -971,7 +1167,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_initial_ts) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).max_initial_ts) as usize - ptr as usize },
88usize, 96usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -981,7 +1177,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).length_penalty) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).length_penalty) as usize - ptr as usize },
92usize, 100usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -991,7 +1187,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).temperature_inc) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).temperature_inc) as usize - ptr as usize },
96usize, 104usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1001,7 +1197,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).entropy_thold) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).entropy_thold) as usize - ptr as usize },
100usize, 108usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1011,7 +1207,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).logprob_thold) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).logprob_thold) as usize - ptr as usize },
104usize, 112usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1021,7 +1217,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).no_speech_thold) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).no_speech_thold) as usize - ptr as usize },
108usize, 116usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1031,7 +1227,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).greedy) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).greedy) as usize - ptr as usize },
112usize, 120usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1041,7 +1237,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).beam_search) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).beam_search) as usize - ptr as usize },
116usize, 124usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1051,7 +1247,7 @@ fn bindgen_test_layout_whisper_full_params() {
); );
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).new_segment_callback) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).new_segment_callback) as usize - ptr as usize },
128usize, 136usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1063,7 +1259,7 @@ fn bindgen_test_layout_whisper_full_params() {
unsafe { unsafe {
::std::ptr::addr_of!((*ptr).new_segment_callback_user_data) as usize - ptr as usize ::std::ptr::addr_of!((*ptr).new_segment_callback_user_data) as usize - ptr as usize
}, },
136usize, 144usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1071,9 +1267,29 @@ fn bindgen_test_layout_whisper_full_params() {
stringify!(new_segment_callback_user_data) stringify!(new_segment_callback_user_data)
) )
); );
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).progress_callback) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(whisper_full_params),
"::",
stringify!(progress_callback)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).progress_callback_user_data) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(whisper_full_params),
"::",
stringify!(progress_callback_user_data)
)
);
assert_eq!( assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).encoder_begin_callback) as usize - ptr as usize }, unsafe { ::std::ptr::addr_of!((*ptr).encoder_begin_callback) as usize - ptr as usize },
144usize, 168usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1085,7 +1301,7 @@ fn bindgen_test_layout_whisper_full_params() {
unsafe { unsafe {
::std::ptr::addr_of!((*ptr).encoder_begin_callback_user_data) as usize - ptr as usize ::std::ptr::addr_of!((*ptr).encoder_begin_callback_user_data) as usize - ptr as usize
}, },
152usize, 176usize,
concat!( concat!(
"Offset of field: ", "Offset of field: ",
stringify!(whisper_full_params), stringify!(whisper_full_params),
@ -1093,6 +1309,28 @@ fn bindgen_test_layout_whisper_full_params() {
stringify!(encoder_begin_callback_user_data) stringify!(encoder_begin_callback_user_data)
) )
); );
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).logits_filter_callback) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(whisper_full_params),
"::",
stringify!(logits_filter_callback)
)
);
assert_eq!(
unsafe {
::std::ptr::addr_of!((*ptr).logits_filter_callback_user_data) as usize - ptr as usize
},
192usize,
concat!(
"Offset of field: ",
stringify!(whisper_full_params),
"::",
stringify!(logits_filter_callback_user_data)
)
);
} }
extern "C" { extern "C" {
pub fn whisper_full_default_params(strategy: whisper_sampling_strategy) -> whisper_full_params; pub fn whisper_full_default_params(strategy: whisper_sampling_strategy) -> whisper_full_params;
@ -1105,6 +1343,15 @@ extern "C" {
n_samples: ::std::os::raw::c_int, n_samples: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_full_with_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
params: whisper_full_params,
samples: *const f32,
n_samples: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_full_parallel( pub fn whisper_full_parallel(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -1117,30 +1364,63 @@ extern "C" {
extern "C" { extern "C" {
pub fn whisper_full_n_segments(ctx: *mut whisper_context) -> ::std::os::raw::c_int; pub fn whisper_full_n_segments(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_full_n_segments_from_state(state: *mut whisper_state) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_full_lang_id(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn whisper_full_lang_id_from_state(state: *mut whisper_state) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_full_get_segment_t0( pub fn whisper_full_get_segment_t0(
ctx: *mut whisper_context, ctx: *mut whisper_context,
i_segment: ::std::os::raw::c_int, i_segment: ::std::os::raw::c_int,
) -> i64; ) -> i64;
} }
extern "C" {
pub fn whisper_full_get_segment_t0_from_state(
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
) -> i64;
}
extern "C" { extern "C" {
pub fn whisper_full_get_segment_t1( pub fn whisper_full_get_segment_t1(
ctx: *mut whisper_context, ctx: *mut whisper_context,
i_segment: ::std::os::raw::c_int, i_segment: ::std::os::raw::c_int,
) -> i64; ) -> i64;
} }
extern "C" {
pub fn whisper_full_get_segment_t1_from_state(
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
) -> i64;
}
extern "C" { extern "C" {
pub fn whisper_full_get_segment_text( pub fn whisper_full_get_segment_text(
ctx: *mut whisper_context, ctx: *mut whisper_context,
i_segment: ::std::os::raw::c_int, i_segment: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char; ) -> *const ::std::os::raw::c_char;
} }
extern "C" {
pub fn whisper_full_get_segment_text_from_state(
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}
extern "C" { extern "C" {
pub fn whisper_full_n_tokens( pub fn whisper_full_n_tokens(
ctx: *mut whisper_context, ctx: *mut whisper_context,
i_segment: ::std::os::raw::c_int, i_segment: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int; ) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_full_n_tokens_from_state(
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" { extern "C" {
pub fn whisper_full_get_token_text( pub fn whisper_full_get_token_text(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -1148,6 +1428,14 @@ extern "C" {
i_token: ::std::os::raw::c_int, i_token: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char; ) -> *const ::std::os::raw::c_char;
} }
extern "C" {
pub fn whisper_full_get_token_text_from_state(
ctx: *mut whisper_context,
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
i_token: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}
extern "C" { extern "C" {
pub fn whisper_full_get_token_id( pub fn whisper_full_get_token_id(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -1155,6 +1443,13 @@ extern "C" {
i_token: ::std::os::raw::c_int, i_token: ::std::os::raw::c_int,
) -> whisper_token; ) -> whisper_token;
} }
extern "C" {
pub fn whisper_full_get_token_id_from_state(
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
i_token: ::std::os::raw::c_int,
) -> whisper_token;
}
extern "C" { extern "C" {
pub fn whisper_full_get_token_data( pub fn whisper_full_get_token_data(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -1162,6 +1457,13 @@ extern "C" {
i_token: ::std::os::raw::c_int, i_token: ::std::os::raw::c_int,
) -> whisper_token_data; ) -> whisper_token_data;
} }
extern "C" {
pub fn whisper_full_get_token_data_from_state(
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
i_token: ::std::os::raw::c_int,
) -> whisper_token_data;
}
extern "C" { extern "C" {
pub fn whisper_full_get_token_p( pub fn whisper_full_get_token_p(
ctx: *mut whisper_context, ctx: *mut whisper_context,
@ -1170,9 +1472,25 @@ extern "C" {
) -> f32; ) -> f32;
} }
extern "C" { extern "C" {
#[doc = ""] pub fn whisper_full_get_token_p_from_state(
state: *mut whisper_state,
i_segment: ::std::os::raw::c_int,
i_token: ::std::os::raw::c_int,
) -> f32;
}
extern "C" {
pub fn whisper_bench_memcpy(n_threads: ::std::os::raw::c_int) -> ::std::os::raw::c_int; pub fn whisper_bench_memcpy(n_threads: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_bench_memcpy_str(
n_threads: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}
extern "C" { extern "C" {
pub fn whisper_bench_ggml_mul_mat(n_threads: ::std::os::raw::c_int) -> ::std::os::raw::c_int; pub fn whisper_bench_ggml_mul_mat(n_threads: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
} }
extern "C" {
pub fn whisper_bench_ggml_mul_mat_str(
n_threads: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}