openai-whisper: 20230918 -> 20231117

https://github.com/openai/whisper/blob/v20231117/CHANGELOG.md

Always propagate openai-triton, since whether or not it is free is
decided by `nixpkgs.config.cudaSupport`.

This allows us to drop the local `cudaSupport` flags in favor of the
nixpkgs-wide one.
This commit is contained in:
Martin Weinelt
2023-11-18 12:33:31 +01:00
parent 19e27c3547
commit 0aeec365ca
2 changed files with 25 additions and 37 deletions
@@ -2,22 +2,23 @@
, fetchFromGitHub
, buildPythonPackage
, substituteAll
, cudaSupport ? false
# build-system
, setuptools
# runtime
, ffmpeg-headless
# propagates
, numpy
, torch
, torchWithCuda
, tqdm
, more-itertools
, transformers
, numba
, numpy
, openai-triton
, scipy
, tiktoken
, torch
, tqdm
, transformers
# tests
, pytestCheckHook
@@ -25,14 +26,14 @@
buildPythonPackage rec {
pname = "whisper";
version = "20230918";
format = "setuptools";
version = "20231117";
pyproject = true;
src = fetchFromGitHub {
owner = "openai";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-wBAanFVEIIzTcoX40P9eI26UdEu0SC/xuife/zi2Xho=";
hash = "sha256-MJ1XjB/GuYUiECCuuHS0NWHvvs+ko0oTvLuDI7zLNiY=";
};
patches = [
@@ -42,31 +43,21 @@ buildPythonPackage rec {
})
];
propagatedBuildInputs = [
numpy
tqdm
more-itertools
transformers
numba
scipy
tiktoken
] ++ lib.optionals (!cudaSupport) [
torch
] ++ lib.optionals (cudaSupport) [
openai-triton
torchWithCuda
nativeBuildInputs = [
setuptools
];
postPatch = ''
substituteInPlace requirements.txt \
--replace "tiktoken==0.3.3" "tiktoken>=0.3.3"
''
# openai-triton is only needed for CUDA support.
# triton needs CUDA to be build.
# -> by making it optional, we can build whisper without unfree packages enabled
+ lib.optionalString (!cudaSupport) ''
sed -i '/if sys.platform.startswith("linux") and platform.machine() == "x86_64":/{N;d}' setup.py
'';
propagatedBuildInputs = [
more-itertools
numba
numpy
openai-triton
scipy
tiktoken
torch
tqdm
transformers
];
preCheck = ''
export HOME=$TMPDIR
@@ -85,7 +76,7 @@ buildPythonPackage rec {
];
meta = with lib; {
changelog = "https://github.com/openai/whisper/blob/v$[version}/CHANGELOG.md";
changelog = "https://github.com/openai/whisper/blob/v${version}/CHANGELOG.md";
description = "General-purpose speech recognition model";
homepage = "https://github.com/openai/whisper";
license = licenses.mit;
+1 -4
View File
@@ -8456,10 +8456,7 @@ self: super: with self; {
openai-triton-bin = callPackage ../development/python-modules/openai-triton/bin.nix { };
openai-whisper = callPackage ../development/python-modules/openai-whisper {
inherit (pkgs.config) cudaSupport;
openai-triton = self.openai-triton-cuda;
};
openai-whisper = callPackage ../development/python-modules/openai-whisper { };
openant = callPackage ../development/python-modules/openant { };