summaryrefslogtreecommitdiff
path: root/audio/whisper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'audio/whisper.cpp')
-rw-r--r--audio/whisper.cpp/Makefile43
-rw-r--r--audio/whisper.cpp/distinfo3
-rw-r--r--audio/whisper.cpp/pkg-descr19
-rw-r--r--audio/whisper.cpp/pkg-message16
-rw-r--r--audio/whisper.cpp/pkg-plist12
5 files changed, 93 insertions, 0 deletions
diff --git a/audio/whisper.cpp/Makefile b/audio/whisper.cpp/Makefile
new file mode 100644
index 000000000000..757869e17f2a
--- /dev/null
+++ b/audio/whisper.cpp/Makefile
@@ -0,0 +1,43 @@
+PORTNAME= whisper.cpp
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.7.6
+CATEGORIES= audio # machine-learning
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Port of OpenAI's Whisper model in C/C++
+WWW= https://github.com/ggerganov/whisper.cpp
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libggml.so:misc/ggml
+
+USES= cmake:testing
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= ggerganov
+
+LDFLAGS+= -pthread
+
+CMAKE_ON= WHISPER_USE_SYSTEM_GGML
+CMAKE_OFF= WHISPER_BUILD_TESTS
+CMAKE_TESTING_ON= WHISPER_BUILD_TESTS \
+ WHISPER_BUILD_EXAMPLES
+
+OPTIONS_DEFINE= EXAMPLES
+OPTIONS_DEFAULT= EXAMPLES # examples contain important user level programs
+OPTIONS_SUB= yes
+
+EXAMPLES_CMAKE_BOOL= WHISPER_BUILD_EXAMPLES
+
+MAKE_JOBS_UNSAFE= yes # for tests to suceed on smaller Vulkan devices: they fail to allocate memory otherwise
+
+post-install:
+ ${INSTALL_SCRIPT} \
+ ${WRKSRC}/models/download-ggml-model.sh \
+ ${STAGEDIR}${PREFIX}/bin/${PORTNAME}-download-ggml-model.sh
+
+# tests as of 1.7.6: 73% tests passed, 3 tests failed out of 11, see https://github.com/ggml-org/whisper.cpp/issues/3404
+
+.include <bsd.port.mk>
diff --git a/audio/whisper.cpp/distinfo b/audio/whisper.cpp/distinfo
new file mode 100644
index 000000000000..520c10ce59cb
--- /dev/null
+++ b/audio/whisper.cpp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1756961106
+SHA256 (ggerganov-whisper.cpp-v1.7.6_GH0.tar.gz) = 166140e9a6d8a36f787a2bd77f8f44dd64874f12dd8359ff7c1f4f9acb86202e
+SIZE (ggerganov-whisper.cpp-v1.7.6_GH0.tar.gz) = 7307730
diff --git a/audio/whisper.cpp/pkg-descr b/audio/whisper.cpp/pkg-descr
new file mode 100644
index 000000000000..6cf0fc25c7ef
--- /dev/null
+++ b/audio/whisper.cpp/pkg-descr
@@ -0,0 +1,19 @@
+High-performance inference of OpenAI's Whisper automatic speech recognition
+(ASR) model:
+
+Features:
+* Plain C/C++ implementation without dependencies
+* Apple Silicon first-class citizen - optimized via ARM NEON, Accelerate
+ framework, Metal and Core ML
+* AVX intrinsics support for x86 architectures
+* VSX intrinsics support for POWER architectures
+* Mixed F16 / F32 precision
+* Integer quantization support
+* Zero memory allocations at runtime
+* Vulkan support
+* Support for CPU-only inference
+* Efficient GPU support for NVIDIA
+* OpenVINO Support
+* Ascend NPU Support
+* Moore Threads GPU Support
+* C-style API
diff --git a/audio/whisper.cpp/pkg-message b/audio/whisper.cpp/pkg-message
new file mode 100644
index 000000000000..47dbc2835108
--- /dev/null
+++ b/audio/whisper.cpp/pkg-message
@@ -0,0 +1,16 @@
+[
+{ type: install
+ message: <<EOM
+You installed whisper.cpp: Port of OpenAI's Whisper model in C/C++
+
+In order to use whisper.cpp you should first download an AI model.
+
+For example:
+$ whisper.cpp-download-ggml-model.sh base.en
+
+Then you can transcribe audio files using a command:
+$ whisper-cli -m ggml-base.en.bin -f {sample}.wav
+
+EOM
+}
+]
diff --git a/audio/whisper.cpp/pkg-plist b/audio/whisper.cpp/pkg-plist
new file mode 100644
index 000000000000..ba5121cef27f
--- /dev/null
+++ b/audio/whisper.cpp/pkg-plist
@@ -0,0 +1,12 @@
+%%EXAMPLES%%bin/vad-speech-segments
+%%EXAMPLES%%bin/whisper-bench
+%%EXAMPLES%%bin/whisper-cli
+%%EXAMPLES%%bin/whisper-server
+bin/whisper.cpp-download-ggml-model.sh
+include/whisper.h
+lib/cmake/whisper/whisper-config.cmake
+lib/cmake/whisper/whisper-version.cmake
+lib/libwhisper.so
+lib/libwhisper.so.1
+lib/libwhisper.so.1.7.6
+libdata/pkgconfig/whisper.pc