Skip to content

Commit ed01e78

Browse files
authored
Remove commented-out WhisperFullParamsWrapper
Removed commented-out class definition for WhisperFullParamsWrapper.
1 parent 08a7936 commit ed01e78

1 file changed

Lines changed: 0 additions & 43 deletions

File tree

src/main.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -295,50 +295,7 @@ int whisper_ctx_init_openvino_encoder_wrapper(struct whisper_context_wrapper * c
295295
const char * cache_dir){
296296
return whisper_ctx_init_openvino_encoder(ctx->ptr, model_path, device, cache_dir);
297297
}
298-
/*
299-
class WhisperFullParamsWrapper : public whisper_full_params {
300-
std::string initial_prompt_str;
301-
std::string suppress_regex_str;
302-
public:
303-
py::function py_progress_callback;
304-
WhisperFullParamsWrapper(const whisper_full_params& params = whisper_full_params())
305-
: whisper_full_params(params),
306-
initial_prompt_str(params.initial_prompt ? params.initial_prompt : ""),
307-
suppress_regex_str(params.suppress_regex ? params.suppress_regex : "") {
308-
initial_prompt = initial_prompt_str.empty() ? nullptr : initial_prompt_str.c_str();
309-
suppress_regex = suppress_regex_str.empty() ? nullptr : suppress_regex_str.c_str();
310-
// progress callback
311-
progress_callback_user_data = this;
312-
progress_callback = [](struct whisper_context* ctx, struct whisper_state* state, int progress, void* user_data) {
313-
auto* self = static_cast<WhisperFullParamsWrapper*>(user_data);
314-
if(self && self->print_progress){
315-
if (self->py_progress_callback) {
316-
// call the python callback
317-
py::gil_scoped_acquire gil;
318-
self->py_progress_callback(progress); // Call Python callback
319-
}
320-
else {
321-
fprintf(stderr, "Progress: %3d%%\n", progress);
322-
} // Default message
323-
}
324-
} ;
325-
}
326-
327-
WhisperFullParamsWrapper(const WhisperFullParamsWrapper& other)
328-
: WhisperFullParamsWrapper(static_cast<const whisper_full_params&>(other)) {}
329-
330-
void set_initial_prompt(const std::string& prompt) {
331-
initial_prompt_str = prompt;
332-
initial_prompt = initial_prompt_str.c_str();
333-
}
334-
335-
void set_suppress_regex(const std::string& regex) {
336-
suppress_regex_str = regex;
337-
suppress_regex = suppress_regex_str.c_str();
338-
}
339-
};
340298

341-
*/
342299
struct WhisperFullParamsWrapper : public whisper_full_params {
343300
std::string initial_prompt_str;
344301
std::string suppress_regex_str;

0 commit comments

Comments
 (0)