diff --git a/.github/workflows/integration-test-qvac-lib-infer-whispercpp.yml b/.github/workflows/integration-test-qvac-lib-infer-whispercpp.yml index 7956b4d8a9..ba99ed6ee0 100644 --- a/.github/workflows/integration-test-qvac-lib-infer-whispercpp.yml +++ b/.github/workflows/integration-test-qvac-lib-infer-whispercpp.yml @@ -46,7 +46,7 @@ jobs: - os: macos-14-xlarge platform: darwin arch: arm64 - - os: windows-2022 + - os: ai-run-windows-gpu platform: win32 arch: x64 @@ -68,7 +68,8 @@ jobs: repository: ${{ inputs.repository || github.repository }} token: ${{ secrets.PAT_TOKEN }} - - name: Configure scoped registry for @tetherto and @qvac packages + - name: Configure scoped registry for @tetherto and @qvac packages (Unix) + if: ${{ matrix.platform != 'win32' }} working-directory: ${{ env.WORKDIR }} env: GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -80,6 +81,7 @@ jobs: set -eu echo "Writing .npmrc for dual registry install…" cat > .npmrc <$null + continue-on-error: true \ No newline at end of file diff --git a/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.cpp b/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.cpp index b818619c4a..72a2b3a371 100644 --- a/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.cpp +++ b/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.cpp @@ -68,13 +68,6 @@ void WhisperModel::load() { throw std::runtime_error("Failed to initialize Whisper context"); } - state_.reset(whisper_init_state(ctx_.get())); - if (state_ == nullptr) { - QLOG( - qvac_lib_inference_addon_cpp::logger::Priority::ERROR, - "Failed to initialize Whisper state"); - throw std::runtime_error("Failed to initialize Whisper state"); - } is_loaded_ = true; QLOG( qvac_lib_inference_addon_cpp::logger::Priority::INFO, @@ -238,9 +231,8 @@ void WhisperModel::warmup() { params.new_segment_callback_user_data = nullptr; // Run warmup inference to "heat up" the model - whisper_full_with_state( + whisper_full( ctx_.get(), - state_.get(), params, silentAudio.data(), static_cast(silentAudio.size())); @@ -282,12 +274,8 @@ void WhisperModel::process(const Input& input) { params.new_segment_callback = onNewSegment; params.new_segment_callback_user_data = &ud; - int result = whisper_full_with_state( - ctx_.get(), - state_.get(), - params, - input.data(), - static_cast(input.size())); + int result = whisper_full( + ctx_.get(), params, input.data(), static_cast(input.size())); const auto t1 = std::chrono::steady_clock::now(); totalWallMs_ += std::chrono::duration(t1 - t0).count(); @@ -371,10 +359,7 @@ bool WhisperModel::configContextIsChanged( return false; } -void WhisperModel::resetContext() { - ctx_.reset(); - state_.reset(); -} +void WhisperModel::resetContext() { ctx_.reset(); } void WhisperModel::setConfig(const WhisperConfig& config) { bool contextChanged = configContextIsChanged(cfg_, config); diff --git a/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.hpp b/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.hpp index 8a66d28785..9c5eec426b 100644 --- a/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.hpp +++ b/packages/qvac-lib-infer-whispercpp/addon/src/model-interface/whisper.cpp/WhisperModel.hpp @@ -121,16 +121,7 @@ class WhisperModel { } }; - struct WhisperStateDeleter { - void operator()(whisper_state* state) const noexcept { - if (state != nullptr) { - whisper_free_state(state); - } - } - }; - std::unique_ptr ctx_{nullptr}; - std::unique_ptr state_{nullptr}; bool stream_ended_ = false; bool is_loaded_ = false; bool is_warmed_up_ = false; diff --git a/packages/qvac-lib-infer-whispercpp/package.json b/packages/qvac-lib-infer-whispercpp/package.json index 69c6c15e2c..3041a2fd0d 100644 --- a/packages/qvac-lib-infer-whispercpp/package.json +++ b/packages/qvac-lib-infer-whispercpp/package.json @@ -1,6 +1,6 @@ { "name": "@qvac/transcription-whispercpp", - "version": "0.3.17", + "version": "0.3.18", "description": "transcription addon for qvac", "addon": true, "engines": { diff --git a/packages/qvac-lib-infer-whispercpp/release-notes/v0.3.18.md b/packages/qvac-lib-infer-whispercpp/release-notes/v0.3.18.md new file mode 100644 index 0000000000..77e98d18f6 --- /dev/null +++ b/packages/qvac-lib-infer-whispercpp/release-notes/v0.3.18.md @@ -0,0 +1,25 @@ +# QVAC Transcription Whisper Addon v0.3.18 Release Notes + +This release updates the whisper.cpp integration to use the latest API and improves Windows platform support for CI/CD workflows. + +## Features + +### Enhanced Windows Platform Support + +The integration test workflow now includes comprehensive Windows support with PowerShell-specific configurations. This includes separate registry configuration steps for Unix and Windows platforms, ensuring proper package authentication across all environments. The workflow now uses the `ai-run-windows-gpu` runner for better GPU-accelerated testing on Windows. + +### Prebuild Package Renaming Support + +Added automatic renaming of prebuild packages from `tetherto__*` to `qvac__*` format during the package download process. This ensures consistency across all platforms and simplifies the build artifact management. + +## Bug Fixes + +### Whisper.cpp API Compatibility + +Updated the integration with whisper.cpp to use the new 4-parameter API for `whisper_full()`. The previous 5-parameter version that included an explicit state parameter has been deprecated. The state is now managed internally by the whisper.cpp context, simplifying the code and removing unnecessary state management overhead. + +Removed the obsolete `whisper_state` member variable and related initialization code, as the new whisper.cpp API handles state management automatically through the context object. + +## Other + +Updated the integration test workflow to use a specific version of `bare@1.26.0` for better build consistency. Added the `always-auth=true` configuration for npm registry authentication to improve reliability when downloading private packages.