Skip to content

Commit

Permalink
[whisper-cpp] Add version 1.7.2 (#25982)
Browse files Browse the repository at this point in the history
Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es>
MartinDelille and AbrilRBS authored Nov 22, 2024
1 parent 51ac960 commit 1c36535
Showing 4 changed files with 18 additions and 50 deletions.
13 changes: 3 additions & 10 deletions recipes/whisper-cpp/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
sources:
"1.7.2":
url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.7.2.tar.gz"
sha256: "d48e1b5b6ee18b931e98ac791eba838f83eb3b81bb8917db37fe9a79fa5e3ccb"
"1.6.2":
url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.6.2.tar.gz"
sha256: "da7988072022acc3cfa61b370b3c51baad017f1900c3dc4e68cb276499f66894"
"1.5.2":
url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.5.2.tar.gz"
sha256: "be9c4d5d4b5f28f02e36f28e602b7d2dcfd734dd1c834ddae91ae8db601e951f"
"1.4.3":
url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.4.3.tar.gz"
sha256: "5f11c0542639bfb0b3c9d1b033d10ccd69ca26e739aec9366766617bc58a6e7c"
"1.2.1":
url: "https://github.com/ggerganov/whisper.cpp/archive/refs/tags/v1.2.1.tar.gz"
sha256: "69d47fc2ba982c42bd5bade4b7c827d5b3ed74b9c59323991c45a9f0f24eb6ed"
patches:
"1.6.2":
- patch_file: "patches/1.6.2-0001-remove_hardcoded_cxxstd.patch"
patch_description: "Remove hardcoded CMAKE_CXX_STANDARD"
patch_type: "conan"
"1.2.1":
- patch_file: "patches/1.2.1-0001-find_package_openblas.patch"
patch_description: "Fix OpenBlas cmake target name"
patch_type: "conan"
27 changes: 13 additions & 14 deletions recipes/whisper-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@
from conan.tools.apple import is_apple_os
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get
from conan.tools.scm import Version

required_conan_version = ">=1.53.0"
required_conan_version = ">=2.1"


class WhisperCppConan(ConanFile):
@@ -48,7 +48,7 @@ class WhisperCppConan(ConanFile):
"no_fma": False,
"no_f16c": False,
"no_accelerate": False,
"metal": False,
"metal": True,
"metal_ndebug": False,
"with_coreml": False,
"coreml_allow_fallback": False,
@@ -73,10 +73,6 @@ def _compilers_minimum_version(self):
},
}.get(self._min_cppstd, {})

@property
def _is_metal_option_available(self):
return is_apple_os(self) and Version(self.version) >= "1.5.2"

@property
def _is_openvino_option_available(self):
return Version(self.version) >= "1.5.2"
@@ -85,17 +81,15 @@ def config_options(self):
if is_apple_os(self):
del self.options.with_blas
else:
del self.options.metal
del self.options.metal_ndebug
del self.options.no_accelerate
del self.options.with_coreml
del self.options.coreml_allow_fallback

if self.settings.os == "Windows":
del self.options.fPIC

if not self._is_metal_option_available:
del self.options.metal
del self.options.metal_ndebug

if not self._is_openvino_option_available:
del self.options.with_openvino

@@ -158,6 +152,9 @@ def generate(self):
if self.options.no_f16c:
tc.variables["WHISPER_NO_F16C"] = True

# TODO: Implement OpenMP support
tc.variables["GGML_OPENMP"] = False

if self.options.get_safe("with_openvino"):
tc.variables["WHISPER_OPENVINO"] = True
# TODO: remove with Conan 1.x support
@@ -166,15 +163,15 @@ def generate(self):
if is_apple_os(self):
if self.options.no_accelerate:
tc.variables["WHISPER_NO_ACCELERATE"] = True
if not self.options.get_safe("metal"):
tc.variables["WHISPER_METAL"] = False
if self.options.get_safe("metal_ndebug"):
tc.variables["WHISPER_METAL_NDEBUG"] = True
if self.options.with_coreml:
tc.variables["WHISPER_COREML"] = True
if self.options.coreml_allow_fallback:
tc.variables["WHISPER_COREML_ALLOW_FALLBACK"] = True
if self._is_metal_option_available:
if Version(self.version) >= "1.7.0":
tc.variables["GGML_METAL"] = self.options.metal
else:
tc.variables["WHISPER_METAL"] = self.options.metal
else:
if self.options.with_blas:
@@ -199,6 +196,8 @@ def package(self):

def package_info(self):
self.cpp_info.libs = ["whisper"]
if Version(self.version) >= "1.7.0":
self.cpp_info.libs.append("ggml")
self.cpp_info.resdirs = ["res"]
self.cpp_info.libdirs = ["lib", "lib/static"]

This file was deleted.

6 changes: 2 additions & 4 deletions recipes/whisper-cpp/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
versions:
"1.7.2":
folder: "all"
"1.6.2":
folder: "all"
"1.5.2":
folder: "all"
"1.4.3":
folder: "all"
"1.2.1":
folder: "all"

0 comments on commit 1c36535

Please sign in to comment.