- Remove OpenAI's Whisper AI recipes and all its dependencies.
- Add recipes for whisper-cpp, whisper-cpp-base and whisper-cpp-tiny
model.
- Add recipe for python-mpd.
- Add voice-agent-config to /etc/default and update config path in
agl-service-voiceagent.service
Bug-AGL: SPEC-5200
Change-Id: Iaebd9c46930144b41659710202e9b737dbe9f60b
Signed-off-by: Anuj Solanki <anuj603362@gmail.com>
+
MIT License
-Copyright (c) 2022 OpenAI
+Copyright (c) 2023-2024 The ggml authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
install -D -m 0644 ${WORKDIR}/agl-app-flutter@flutter_voiceassistant.service ${D}${systemd_system_unitdir}/agl-app-flutter@flutter_voiceassistant.service
}
+
FILES:${PN} += "${datadir} "
SUMMARY = "A gRPC-based voice agent service designed for Automotive Grade Linux (AGL)."
-HOMEPAGE = "https://github.com/malik727/agl-service-voiceagent"
+.HOMEPAGE = "https://github.com/malik727/agl-service-voiceagent"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4202492ed9afcab3aaecc4a9ec32adb2"
SRC_URI = " \
- file://agl-service-voiceagent.service \
git://gerrit.automotivelinux.org/gerrit/apps/agl-service-voiceagent;protocol=https;branch=${AGL_BRANCH} \
+ file://agl-service-voiceagent.service \
+ file://voice-agent-config.ini \
"
SRCREV = "${AUTOREV}"
VOSK_STT_MODEL_NAME ?= "vosk-model-small-en-us-0.15"
# Wake Word Detection Model Name
VOSK_WWD_MODEL_NAME ?= "vosk-model-small-en-us-0.15"
-WAKE_WORD ?= "hello auto"
+WAKE_WORD ?= "hey automotive"
DEPENDS += " \
python3 \
# Initialize our service definition
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/agl-service-voiceagent.service ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/agl-service-voiceagent.service ${D}${systemd_system_unitdir}/agl-service-voiceagent.service
fi
+
+ # Copy config file to etc/default
+ install -d ${D}/etc/default/
+ cp -R ${WORKDIR}/voice-agent-config.ini ${D}/etc/default/
}
RDEPENDS:${PN} += " \
kuksa-client \
python3-snips-inference-agl \
vosk \
- whisper \
+ whisper-cpp \
+ python3-python-mpd2 \
"
-FILES:${PN} += "/usr/share/nlu/"
+FILES:${PN} += "/usr/share/nlu/ /etc/default/"
After=network.target
[Service]
-ExecStart=/usr/bin/voiceagent-service run-server --default
+ExecStart=/usr/bin/voiceagent-service run-server --config /etc/default/voice-agent-config.ini
Restart=always
[Install]
--- /dev/null
+[General]
+base_audio_dir = /usr/share/nlu/commands/
+vosk_model_path = /usr/share/vosk/vosk-model-small-en-us-0.15/
+whisper_model_path = /usr/share/whisper/tiny.pt
+whisper_cpp_path = /usr/bin/whisper-cpp
+whisper_cpp_model_path = /usr/share/whisper-cpp/models/tiny.en.bin
+wake_word_model_path = /usr/share/vosk/vosk-model-small-en-us-0.15/
+snips_model_path = /usr/share/nlu/snips/model/
+channels = 1
+sample_rate = 16000
+bits_per_sample = 16
+wake_word = hey automotive
+server_port = 51053
+server_address = 127.0.0.1
+rasa_model_path = /usr/share/nlu/rasa/models/
+rasa_server_port = 51054
+rasa_detached_mode = 1
+base_log_dir = /usr/share/nlu/logs/
+store_voice_commands = 0
+online_mode = 0
+online_mode_address = 65.108.107.216
+online_mode_port = 50051
+online_mode_timeout = 15
+mpd_ip = 127.0.0.1
+mpd_port = 6600
+
+[Kuksa]
+ip = 127.0.0.1
+port = 55555
+protocol = grpc
+insecure = 0
+token = /usr/lib/python3.12/site-packages/kuksa_certificates/jwt/super-admin.json.token
+tls_server_name = Server
+
+[VSS]
+hostname = localhost
+port = 55555
+protocol = grpc
+insecure = 0
+token_filename = /etc/xdg/AGL/agl-vss-helper/agl-vss-helper.token
+ca_cert_filename = /etc/kuksa-val/CA.pem
+tls_server_name = Server
+
+[Mapper]
+intents_vss_map = /usr/share/nlu/mappings/intents_vss_map.json
+vss_signals_spec = /usr/share/nlu/mappings/vss_signals_spec.json
--- /dev/null
+SUMMARY = "A Python MPD client library"
+HOMEPAGE = "https://github.com/Mic92/python-mpd2"
+AUTHOR = "Joerg Thalheim <joerg@thalheim.io>"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "https://files.pythonhosted.org/packages/53/be/e77206eb35eb37ccd3506fba237e1431431d04c482707730ce2a6802e95c/python-mpd2-3.1.1.tar.gz"
+SRC_URI[md5sum] = "b218d6f233c23da0bc82c372308bbf8d"
+SRC_URI[sha256sum] = "4baec3584cc43ed9948d5559079fafc2679b06b2ade273e909b3582654b2b3f5"
+
+S = "${WORKDIR}/python-mpd2-3.1.1"
+
+RDEPENDS_${PN} = ""
+
+inherit setuptools3
--- /dev/null
+SUMMARY = "Whisper-cpp base model"
+HOMEPAGE = "https://github.com/ggerganov/whisper.cpp"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${THISDIR}/../../licenses/LICENSE;md5=7a3cb84505132167069a95fa683a011c"
+
+SRC_URI = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.bin"
+SRC_URI[sha256sum] = "60ed5bc3dd14eea856493d334349b405782ddcaf0028d4b5df4088345fba2efe"
+
+do_install() {
+ # Install the models
+ install -d ${D}${datadir}/whisper-cpp/models
+ install -m 0644 ${WORKDIR}/ggml-base.bin ${D}${datadir}/whisper-cpp/models/base.bin
+}
+
+FILES:${PN} += " /usr /usr/share /usr/share/whisper-cpp/* "
--- /dev/null
+SUMMARY = "Whisper-cpp base model"
+HOMEPAGE = "https://github.com/ggerganov/whisper.cpp"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${THISDIR}/../../licenses/LICENSE;md5=7a3cb84505132167069a95fa683a011c"
+
+SRC_URI = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en.bin"
+SRC_URI[sha256sum] = "921e4cf8686fdd993dcd081a5da5b6c365bfde1162e72b08d75ac75289920b1f"
+
+do_install() {
+ # Install the models
+ install -d ${D}${datadir}/whisper-cpp/models
+ install -m 0644 ${WORKDIR}/ggml-tiny.en.bin ${D}${datadir}/whisper-cpp/models/tiny.en.bin
+}
+
+FILES:${PN} += " /usr /usr/share /usr/share/whisper-cpp/* "
--- /dev/null
+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"
# package in meta-oe is newer
BBMASK += "meta-tensorflow/recipes-devtools/python/python3-gast_0.4.0.bb"
+# needed for rasa
+# ${METADIR}/external/meta-tensorflow \
+#
python3-sounddevice \
flutter-voiceassistant \
agl-service-voiceagent \
- whisper \
- openai-whisper-base \
+ whisper-cpp \
+ whisper-cpp-tiny \
"
EXTRA_IMAGE_FEATURES += "agl-offline-voice-agent"
PREFERRED_RPROVIDER_vosk-model ?= "vosk-model-small-en-us"
-PREFERRED_RPROVIDER_whisper-model ?= "openai-whisper-base"
+PREFERRED_RPROVIDER_whisper-model ?= "whisper-cpp-tiny"
# bump bazel limits
BAZEL_JOBS = "HOST_CPUS*.4"
BAZEL_MEM = "HOST_RAM*.4"
LICENSE_FLAGS_ACCEPTED += "commercial_ffmpeg"
+
+# no rasa support currently
+# python3-rasa \
+# rasa-model-agl \
+#
\ No newline at end of file