summaryrefslogtreecommitdiffstats
path: root/meta-offline-voice-agent/recipes-whisper/whisper-cpp/whisper-cpp_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-offline-voice-agent/recipes-whisper/whisper-cpp/whisper-cpp_git.bb')
-rw-r--r--meta-offline-voice-agent/recipes-whisper/whisper-cpp/whisper-cpp_git.bb39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta-offline-voice-agent/recipes-whisper/whisper-cpp/whisper-cpp_git.bb b/meta-offline-voice-agent/recipes-whisper/whisper-cpp/whisper-cpp_git.bb
new file mode 100644
index 00000000..0e3e9a17
--- /dev/null
+++ b/meta-offline-voice-agent/recipes-whisper/whisper-cpp/whisper-cpp_git.bb
@@ -0,0 +1,39 @@
+DESCRIPTION = "Whisper.cpp - Port of OpenAI's Whisper model in C++ for faster and smaller inference"
+HOMEPAGE = "https://github.com/ggerganov/whisper.cpp"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1539dadbedb60aa18519febfeab70632"
+
+SRC_URI = "git://github.com/ggerganov/whisper.cpp.git;protocol=https;branch=master"
+
+SRCREV = "81c999fe0a25c4ebbfef10ed8a1a96df9cfc10fd"
+
+DEPENDS = "ffmpeg openblas"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+do_configure:prepend() {
+ sed -i 's/-march=native//g' ${S}/Makefile
+ sed -i 's/-mtune=native//g' ${S}/Makefile
+}
+
+
+# Specify the model you want to download
+WHISPER_MODEL ?= "base.en"
+
+do_compile() {
+ export CXXFLAGS="${CXXFLAGS} -I${STAGING_INCDIR}/openblas"
+ export LDFLAGS="${LDFLAGS} -lopenblas"
+ cd ${S}
+ oe_runmake GGML_OPENBLAS=1
+}
+
+do_install() {
+ # Install the main binary
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/main ${D}${bindir}/whisper-cpp
+}
+
+FILES_${PN} += "${datadir}/whisper-cpp/models/* ${datadir}/* ${bindir}/* /usr/share "
+RDEPENDS:${PN} += "openblas ffmpeg"