python313Packages.kanalizer: init at 0.1.1

This commit is contained in:
TomaSajt
2025-07-03 15:54:10 +02:00
parent e769ea2dcd
commit fad46aabd6
2 changed files with 73 additions and 0 deletions
@@ -0,0 +1,71 @@
{
lib,
buildPythonPackage,
fetchurl,
fetchFromGitHub,
rustPlatform,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "kanalizer";
version = "0.1.1";
pyproject = true;
src = fetchFromGitHub {
owner = "VOICEVOX";
repo = "kanalizer";
tag = version;
hash = "sha256-6GxTVlc0Ec80LYQoGgLVRVoi05u6vwt5WGkd4UYX2Lg=";
};
sourceRoot = "${src.name}/infer";
model =
let
modelTag = "v5";
in
fetchurl {
url = "https://huggingface.co/VOICEVOX/kanalizer-model/resolve/${modelTag}/model/c2k.safetensors";
hash = "sha256-sKhunAsN9Uwz2O1+eFQN8fh09eq67cFotTtLHsWJBRM=";
};
prePatch = ''
substituteInPlace Cargo.toml \
--replace-fail 'version = "0.0.0"' 'version = "${version}"'
ln -s "$model" crates/kanalizer-rs/models/model-c2k.safetensors
'';
cargoDeps = rustPlatform.fetchCargoVendor {
inherit
pname
version
src
sourceRoot
;
hash = "sha256-2vnld5ReLsjm0kRoRAXhm+d0yj7AjfEr83xXhuyPbOU=";
};
buildAndTestSubdir = "crates/kanalizer-py";
nativeBuildInputs = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "kanalizer" ];
meta = {
description = "Library that guesses the Japanese pronounciation of English words";
homepage = "https://github.com/VOICEVOX/kanalizer";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tomasajt ];
sourceProvenance = with lib.sourceTypes; [
fromSource
binaryNativeCode # the model file
];
};
}
+2
View File
@@ -7555,6 +7555,8 @@ self: super: with self; {
kalshi-python = callPackage ../development/python-modules/kalshi-python { };
kanalizer = callPackage ../development/python-modules/kanalizer { };
kanidm = callPackage ../development/python-modules/kanidm { };
kaptan = callPackage ../development/python-modules/kaptan { };