Add whisperx

This commit is contained in:
Geoffrey Frogeye 2024-11-15 22:41:26 +01:00
parent 22b844df2c
commit 84268f3c47
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
3 changed files with 39 additions and 1 deletions

View file

@ -8,7 +8,7 @@
./common.nix ./common.nix
./desktop ./desktop
./dev ./dev
./extra.nix ./extra
./gaming ./gaming
./git ./git
./gpg ./gpg

View file

@ -21,6 +21,7 @@
# Communication # Communication
signal-desktop signal-desktop
(pkgs.callPackage ./whisperx.nix {}) # Transcribe voice messages
# downloading # downloading
# transmission TODO Collision if both transmissions are active? # transmission TODO Collision if both transmissions are active?

37
hm/extra/whisperx.nix Normal file
View file

@ -0,0 +1,37 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.python3Packages.buildPythonPackage {
pname = "whisperx";
version = "2024-08-19";
# pypi doesn't have the requirements.txt file, and it's required
src = pkgs.fetchFromGitHub {
owner = "m-bain";
repo = "whisperX";
rev = "9e3a9e0e38fcec1304e1784381059a0e2c670be5"; # git doesn't have tags
hash = "sha256-IVtn9fe/yi4+fbH57s9LoiREnMZ2nhEObp1a4R/7gHg=";
};
pyproject = true;
dependencies = [
pkgs.python3Packages.torch
pkgs.python3Packages.torchaudio
(pkgs.python3Packages.faster-whisper.overrideAttrs (old: {
# 1.0.2 is actually breaking APIs (requires hotwords argument)
src = pkgs.fetchFromGitHub {
owner = "SYSTRAN";
repo = "faster-whisper";
rev = "v1.0.0";
hash = "sha256-0fE8X1d6CgDrrHtRudksN/tIGRtBKMvoNwkSVyFNda4=";
};
}))
pkgs.python3Packages.transformers
pkgs.python3Packages.pyannote-audio # Not in the requirements.txt for some reason
pkgs.python3Packages.pandas
pkgs.python3Packages.nltk
];
build-system = [
pkgs.python3Packages.setuptools
];
pythonImportsCheck = [
"whisperx"
];
}