diff --git a/setup.py b/setup.py index 74aef1e..38c1b33 100644 --- a/setup.py +++ b/setup.py @@ -131,7 +131,7 @@ def build_extension(self, ext: CMakeExtension) -> None: # logic and declaration, and simpler if you include description/version in a file. setup( name="pywhispercpp", - version="1.0.6", + version="1.0.7", author="abdeladim-s", description="Python bindings for whisper.cpp", long_description=long_description, diff --git a/src/main.cpp b/src/main.cpp index 4738ae9..ec95bf3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -486,7 +486,10 @@ PYBIND11_MODULE(_pywhispercpp, m) { .def_readwrite("audio_ctx", &whisper_full_params::audio_ctx) .def_readwrite("prompt_tokens", &whisper_full_params::prompt_tokens) .def_readwrite("prompt_n_tokens", &whisper_full_params::prompt_n_tokens) - .def_readwrite("language", &whisper_full_params::language) + .def_property("language", [](whisper_full_params &self) {return py::str(self.language);}, + [](whisper_full_params &self, const char *new_c) {char* c = (char *)malloc(sizeof(new_c)); + strcpy(c, new_c); self.language = c;}) + .def_readwrite("suppress_blank", &whisper_full_params::suppress_blank) .def_readwrite("suppress_non_speech_tokens", &whisper_full_params::suppress_non_speech_tokens) .def_readwrite("temperature", &whisper_full_params::temperature)