feat: tts

:q
This commit is contained in:
2026-03-24 13:52:34 +01:00
parent bba4bd532c
commit 5b185a1b14
4 changed files with 71 additions and 6 deletions

View File

@@ -62,12 +62,25 @@
system = "x86_64-linux";
in
{
packages.${system} = {
qwen-asr = nixpkgs.legacyPackages.${system}.callPackage ./packages/qwen-asr.nix { };
llama-swap = nixpkgs.legacyPackages.${system}.callPackage ./packages/llama-swap { };
z-image-models = nixpkgs.legacyPackages.${system}.callPackage ./packages/z-image-models { };
whisper-models = nixpkgs.legacyPackages.${system}.callPackage ./packages/whisper-models { };
};
packages.${system} =
let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"fish-speech-models"
];
};
in
{
qwen-asr = pkgs.callPackage ./packages/qwen-asr.nix { };
llama-swap = pkgs.callPackage ./packages/llama-swap { };
z-image-models = pkgs.callPackage ./packages/z-image-models { };
whisper-models = pkgs.callPackage ./packages/whisper-models { };
fish-speech-models = pkgs.callPackage ./packages/fish-speech-models { };
};
# legolas
nixosConfigurations.legolas = nixpkgs.lib.nixosSystem {

View File

@@ -7,12 +7,14 @@
...
}:
{
environment.systemPackages = [
pkgs.unstable.llama-cpp-vulkan
pkgs.unstable.stable-diffusion-cpp-vulkan
pkgs.unstable.whisper-cpp-vulkan
inputs.self.packages.${system}.z-image-models
inputs.self.packages.${system}.whisper-models
inputs.self.packages.${system}.fish-speech-models
];
services.llama-swap = {
@@ -28,6 +30,7 @@
whisper-server = lib.getExe' pkgs.unstable.whisper-cpp-vulkan "whisper-server";
z-image-models = inputs.self.packages.${system}.z-image-models;
whisper-models = inputs.self.packages.${system}.whisper-models;
fish-speech-models = inputs.self.packages.${system}.fish-speech-models;
in
{
healthCheckTimeout = 180;
@@ -125,6 +128,19 @@
];
macros.model = "${whisper-models}/models/nb-whisper-small-q5_0.bin";
};
"fish-speech-s2-pro" = {
cmd = "docker run --rm --name fish-speech-$\{PORT\} -p $\{PORT\}:8080 -v $\{models\}/s2-pro:/app/checkpoints/s2-pro:ro fishaudio/fish-speech:server-cpu";
cmdStop = "docker stop fish-speech-$\{PORT\}";
checkEndpoint = "/v1/health";
proxy = "http://127.0.0.1:$\{PORT\}";
ttl = 0;
aliases = [
"tts-1"
"tts"
"fish-speech"
];
macros.models = "${fish-speech-models}/models";
};
};
};
};

View File

@@ -6,6 +6,7 @@ ps: with ps; [
numpy
scipy
pandas
polars
matplotlib
seaborn
scikit-learn

View File

@@ -0,0 +1,35 @@
{
lib,
fetchgit,
runCommand,
}:
let
src = fetchgit {
url = "https://huggingface.co/fishaudio/s2-pro";
rev = "1de9996b6be38b745688de084d87a5633f714e4e";
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
fetchLFS = true;
};
in
runCommand "fish-speech-models"
{
version = "1.0.0";
meta = {
description = "Fish Audio S2 Pro TTS model";
homepage = "https://huggingface.co/fishaudio/s2-pro";
license = {
shortName = "fish-audio-research";
fullName = "Fish Audio Research License";
url = "https://huggingface.co/fishaudio/s2-pro/blob/main/LICENSE.md";
free = false;
redistributable = true;
};
platforms = lib.platforms.all;
};
}
''
mkdir -p $out/models
cp -r ${src} $out/models/s2-pro
chmod -R u+w $out/models/s2-pro
''