-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add whisper pipeline - Initial commit #789
Add whisper pipeline - Initial commit #789
Conversation
src/cpp/include/openvino/genai/whisper_speech_recognition_pipeline.hpp
Outdated
Show resolved
Hide resolved
src/cpp/include/openvino/genai/whisper_speech_recognition_pipeline.hpp
Outdated
Show resolved
Hide resolved
throw std::runtime_error("Failed to read WAV file " + wav_file_path); | ||
} | ||
|
||
ov::genai::WhisperSpeechRecognitionPipeline pipeline{model_path}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does GPU work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We checked with @yatarkan integrated GPU on his machine, it works fine. Trying to check on discrete one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check separately
samples/cpp/whisper_speech_recognition/whisper_speech_recognition.cpp
Outdated
Show resolved
Hide resolved
samples/cpp/whisper_speech_recognition/whisper_speech_recognition.cpp
Outdated
Show resolved
Hide resolved
src/cpp/include/openvino/genai/whisper_speech_recognition_pipeline.hpp
Outdated
Show resolved
Hide resolved
m_impl->m_generation_config.validate(); | ||
} | ||
|
||
ov::genai::WhisperPipeline::~WhisperPipeline() = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need it at all? I think you can omit dtor definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried to remove it but I got compilation error. As I understood use of std::unique_ptr<Impl>
class member requires class to have a destructor: https://stackoverflow.com/questions/34072862/why-is-error-invalid-application-of-sizeof-to-an-incomplete-type-using-uniqu
I guess there is a way to implement it without need of WhisperPipeline
explicit destructor, please let me know if I need to investigate.
Error:
[build] /usr/include/c++/11/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = ov::genai::WhisperPipeline::Impl]’:
[build] /usr/include/c++/11/bits/unique_ptr.h:361:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = ov::genai::WhisperPipeline::Impl; _Dp = std::default_delete<ov::genai::WhisperPipeline::Impl>]’
[build] /opt/home/suvorova/projects/openvino/openvino.genai/src/cpp/include/openvino/genai/whisper_pipeline.hpp:20:30: required from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can use shared_ptr then?
@@ -11,7 +11,10 @@ | |||
#include <openvino/runtime/auto/properties.hpp> | |||
#include "../cpp/src/tokenizers_path.hpp" | |||
|
|||
#include "./utils.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "./utils.hpp" | |
#include "utils.hpp" |
just add target_include dirs to current folder in cmake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naively adding target_include_dirs
didn't work. It compiles successfully, but python code couldn't find symbol in utils.cpp
. I'll add todo to address that.
pybind11_add_module(py_generate_pipeline py_generate_pipeline.cpp)
target_include_directories(py_generate_pipeline PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/")
run: | | ||
. "${{ env.OV_INSTALL_DIR }}/setupvars.ps1" | ||
python -m pip install . --verbose | ||
python -m pytest ./tests/python_tests/test_whisper_generate_api.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we test only via either wheel or C++ archive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed existing pattern here. I guess we can run just some single test to ensure both (wheel and C++ archive) approaches work and not the whole test suite. @Wovchena what's your thoughts on this?
This is work in progress PR. Todos:
assets/whisper/mel_filters_data.bin
on initializationdr_wav.h
withFetchContent
ov::genai::Tokenizer
RemoteTensor
for GPUCurrent limitations:
Tickets: CVS-147994, CVS-146010, CVS-152522