summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-vosk
diff options
context:
space:
mode:
authorAnuj Solanki <anuj603362@gmail.com>2024-07-03 17:28:05 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2024-08-30 11:53:02 +0000
commit8607d696eca482e025a9ca30ee992707211d1f11 (patch)
treeca4342a7db0465199119d1c24bf3e824a0f0a1c3 /meta-offline-voice-agent/recipes-vosk
parent65f1ec44778eaa59c2c74bf5fbb22a670b6231a0 (diff)
Integrate Whisper AI into AGL Voice Agent and Update Dependencies
V1: - Removed the following recipes from meta-offline-voiceagent: - python3-scipy - python3-scikit-learn - python3-openblas - python3-lapack - python3-numpy - Updated to use meta-python-ai layer for: - python3-scipy - python3-scikit-learn - python3-openblas - python3-lapack - python3-numpy - python3-pytorch - Added all the required recipes for Whisper AI: - Included recipes for Whisper AI base and tiny model - Updated recipes for: - python3-uvloop - python3-python-crfsuite V2: - Remove vulkan from DISTRO_FEATURES as it has become coditional at upstream - Fix flutter_voiceassistant service - Update recipe of llvmlite to include the wheel for aarch64 also. V3: - Fix llvmlite recipe and some patches - Removes rasa and its dependencies - Fix agl-service-voiceagent.service Bug-AGL: SPEC-5200 Change-Id: I429e7d4b98fbbe1a4f8c1341ac8918d7d177b382 Signed-off-by: Anuj Solanki <anuj603362@gmail.com>
Diffstat (limited to 'meta-offline-voice-agent/recipes-vosk')
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch101
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb1
-rw-r--r--meta-offline-voice-agent/recipes-vosk/vosk-model/vosk-model-small-en-us_0.15.bb2
3 files changed, 103 insertions, 1 deletions
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch
new file mode 100644
index 00000000..a4d6b6bc
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi/0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch
@@ -0,0 +1,101 @@
+From e23562daf660dbf2aed0fe0ee3bd47165f73c437 Mon Sep 17 00:00:00 2001
+From: Anuj Solanki <anuj603362@gmail.com>
+Date: Fri, 7 Jun 2024 16:54:08 +0200
+Subject: [PATCH] Fixup wrappers for compilation with openblas 0.3.27
+
+vosk-kaldi if compiled with openblas from meta-python-ai
+needs these wrappers adapted to function.
+
+Upstream-Status: Inaproppriate.
+Signed-off-by: Anuj Solanki <anuj603362@gmail.com>
+---
+ src/matrix/cblas-wrappers.h | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/matrix/cblas-wrappers.h b/src/matrix/cblas-wrappers.h
+index f869ab7e0..0bb306ba9 100644
+--- a/src/matrix/cblas-wrappers.h
++++ b/src/matrix/cblas-wrappers.h
+@@ -383,33 +383,33 @@ inline void mul_elements(
+ // add clapack here
+ #if !defined(HAVE_ATLAS)
+ inline void clapack_Xtptri(KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *result) {
+- stptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
++ LAPACK_stptri(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
+ }
+ inline void clapack_Xtptri(KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *result) {
+- dtptri_(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
++ LAPACK_dtptri(const_cast<char *>("U"), const_cast<char *>("N"), num_rows, Mdata, result);
+ }
+ //
+ inline void clapack_Xgetrf2(KaldiBlasInt *num_rows, KaldiBlasInt *num_cols,
+ float *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot,
+ KaldiBlasInt *result) {
+- sgetrf_(num_rows, num_cols, Mdata, stride, pivot, result);
++ LAPACK_sgetrf(num_rows, num_cols, Mdata, stride, pivot, result);
+ }
+ inline void clapack_Xgetrf2(KaldiBlasInt *num_rows, KaldiBlasInt *num_cols,
+ double *Mdata, KaldiBlasInt *stride, KaldiBlasInt *pivot,
+ KaldiBlasInt *result) {
+- dgetrf_(num_rows, num_cols, Mdata, stride, pivot, result);
++ LAPACK_dgetrf(num_rows, num_cols, Mdata, stride, pivot, result);
+ }
+
+ //
+ inline void clapack_Xgetri2(KaldiBlasInt *num_rows, float *Mdata, KaldiBlasInt *stride,
+ KaldiBlasInt *pivot, float *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- sgetri_(num_rows, Mdata, stride, pivot, p_work, l_work, result);
++ LAPACK_sgetri(num_rows, Mdata, stride, pivot, p_work, l_work, result);
+ }
+ inline void clapack_Xgetri2(KaldiBlasInt *num_rows, double *Mdata, KaldiBlasInt *stride,
+ KaldiBlasInt *pivot, double *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- dgetri_(num_rows, Mdata, stride, pivot, p_work, l_work, result);
++ LAPACK_dgetri(num_rows, Mdata, stride, pivot, p_work, l_work, result);
+ }
+ //
+ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+@@ -417,7 +417,7 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+ float *sv, float *Vdata, KaldiBlasInt *vstride,
+ float *Udata, KaldiBlasInt *ustride, float *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- sgesvd_(v, u,
++ LAPACK_sgesvd(v, u,
+ num_cols, num_rows, Mdata, stride,
+ sv, Vdata, vstride, Udata, ustride,
+ p_work, l_work, result);
+@@ -427,7 +427,7 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+ double *sv, double *Vdata, KaldiBlasInt *vstride,
+ double *Udata, KaldiBlasInt *ustride, double *p_work,
+ KaldiBlasInt *l_work, KaldiBlasInt *result) {
+- dgesvd_(v, u,
++ LAPACK_dgesvd(v, u,
+ num_cols, num_rows, Mdata, stride,
+ sv, Vdata, vstride, Udata, ustride,
+ p_work, l_work, result);
+@@ -435,20 +435,20 @@ inline void clapack_Xgesvd(char *v, char *u, KaldiBlasInt *num_cols,
+ //
+ void inline clapack_Xsptri(KaldiBlasInt *num_rows, float *Mdata,
+ KaldiBlasInt *ipiv, float *work, KaldiBlasInt *result) {
+- ssptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
++ LAPACK_ssptri(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
+ }
+ void inline clapack_Xsptri(KaldiBlasInt *num_rows, double *Mdata,
+ KaldiBlasInt *ipiv, double *work, KaldiBlasInt *result) {
+- dsptri_(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
++ LAPACK_dsptri(const_cast<char *>("U"), num_rows, Mdata, ipiv, work, result);
+ }
+ //
+ void inline clapack_Xsptrf(KaldiBlasInt *num_rows, float *Mdata,
+ KaldiBlasInt *ipiv, KaldiBlasInt *result) {
+- ssptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
++ LAPACK_ssptrf(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
+ }
+ void inline clapack_Xsptrf(KaldiBlasInt *num_rows, double *Mdata,
+ KaldiBlasInt *ipiv, KaldiBlasInt *result) {
+- dsptrf_(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
++ LAPACK_dsptrf(const_cast<char *>("U"), num_rows, Mdata, ipiv, result);
+ }
+ #else
+ inline void clapack_Xgetrf(MatrixIndexT num_rows, MatrixIndexT num_cols,
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
index 19206d9a..0630abcb 100644
--- a/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-kaldi/vosk-kaldi_git.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://../COPYING;md5=a10e448a64dbd3723ff3fb2f397fba2e \
SRC_URI = "git://github.com/alphacep/kaldi.git;protocol=https;branch=vosk \
file://0001-Fixes-for-shared-library-compilation.patch \
+ file://0001-Fixup-wrappers-for-compilation-with-openblas-0.3.27.patch;patchdir=.. \
"
PV = "1.0+git${SRCPV}"
diff --git a/meta-offline-voice-agent/recipes-vosk/vosk-model/vosk-model-small-en-us_0.15.bb b/meta-offline-voice-agent/recipes-vosk/vosk-model/vosk-model-small-en-us_0.15.bb
index 929ad0d4..b33121aa 100644
--- a/meta-offline-voice-agent/recipes-vosk/vosk-model/vosk-model-small-en-us_0.15.bb
+++ b/meta-offline-voice-agent/recipes-vosk/vosk-model/vosk-model-small-en-us_0.15.bb
@@ -11,7 +11,7 @@ SRC_URI = " \
# License listed on https://alphacephei.com/vosk/models
SRC_URI[model.sha256sum] = "30f26242c4eb449f948e42cb302dd7a686cb29a3423a8367f99ff41780942498"
-SRC_URI[license.sha256sum] = "46220c6d381bf1c230699077e3a693b2474f4cc768a167f25ced5034ab96890b"
+SRC_URI[license.sha256sum] = "1045889590458da11c214de89a4cc21b7eabacdd57e993e1d03105618cacad61"
do_install() {
install -d ${D}/usr/share/vosk