From fcaf34e537ac3b237f83d8b1c005c70cb5d30104 Mon Sep 17 00:00:00 2001 From: Bear-03 <64696287+Bear-03@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:05:06 +0200 Subject: [PATCH] feat(nix): fetch model files --- nix/shells/default/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nix/shells/default/default.nix b/nix/shells/default/default.nix index 352fcb0..09d3d6f 100644 --- a/nix/shells/default/default.nix +++ b/nix/shells/default/default.nix @@ -1,12 +1,20 @@ { pkgs, lib, ... }: let - # Libs are needed to run the examples + # Libs and model files are needed to run the examples for testing purposes voskVersion = "0.3.45"; arch = builtins.elemAt (lib.strings.splitString "-" pkgs.system) 0; voskLib = pkgs.fetchzip { url = "https://github.com/alphacep/vosk-api/releases/download/v${voskVersion}/vosk-linux-${arch}-${voskVersion}.zip"; hash = "sha256-ToMDbD5ooFMHU0nNlfpLynF29kkfMknBluKO5PipLFY="; }; + model = pkgs.fetchzip { + url = "https://alphacephei.com/vosk/models/vosk-model-small-en-us-0.15.zip"; + hash = "sha256-CIoPZ/krX+UW2w7c84W3oc1n4zc9BBS/fc8rVYUthuY="; + }; + speakerModel = pkgs.fetchzip { + url = "https://alphacephei.com/vosk/models/vosk-model-spk-0.4.zip"; + hash = "sha256-wpTfZnEL1sCfpLhp+l62d8GcOinR15XnSHaLVASH4RA="; + }; in pkgs.mkShell { buildInputs = with pkgs; [ @@ -22,4 +30,8 @@ pkgs.mkShell { pkgs.stdenv.cc.cc voskLib ]; + + # Run the examples like "cargo run --example $MODEL $SPEAKER_MODEL" etc. + MODEL = model; + SPEAKER_MODEL = speakerModel; } \ No newline at end of file