From 70ad8f9b1dcd5673bb3558bf287f90e375eb3d78 Mon Sep 17 00:00:00 2001 From: Chidi Williams Date: Sun, 8 Jan 2023 16:49:33 +0000 Subject: [PATCH] Upgrade whisper.cpp (#325) --- Makefile | 3 +++ buzz/transcriber.py | 2 +- whisper.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 87a7043f..a4654596 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,9 @@ ifeq ($(UNAME_S),Darwin) ifeq (,$(findstring AVX1.0,$(AVX1_M))) CMAKE_FLAGS += -DWHISPER_NO_AVX=ON endif + ifeq (,$(findstring FMA,$(AVX1_M))) + CMAKE_FLAGS += -DWHISPER_NO_FMA=ON + endif AVX2_M := $(shell sysctl machdep.cpu.leaf7_features) ifeq (,$(findstring AVX2,$(AVX2_M))) CMAKE_FLAGS += -DWHISPER_NO_AVX2=ON diff --git a/buzz/transcriber.py b/buzz/transcriber.py index b02600aa..7b5e4848 100644 --- a/buzz/transcriber.py +++ b/buzz/transcriber.py @@ -536,7 +536,7 @@ def whisper_cpp_params( class WhisperCpp: def __init__(self, model: str) -> None: - self.ctx = whisper_cpp.whisper_init(model.encode('utf-8')) + self.ctx = whisper_cpp.whisper_init_from_file(model.encode('utf-8')) def transcribe(self, audio: Union[np.ndarray, str], params: Any): if isinstance(audio, str): diff --git a/whisper.cpp b/whisper.cpp index 331c0bbd..ff3e3793 160000 --- a/whisper.cpp +++ b/whisper.cpp @@ -1 +1 @@ -Subproject commit 331c0bbddc112231b6e896166519e64831f42f9d +Subproject commit ff3e3793bcbbbfe1c451c9bc169925e44667a241