python313Packages.kanalizer: init at 0.1.1
This commit is contained in:
@@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -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 { };
|
||||
|
||||
Reference in New Issue
Block a user