Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: python3Packages.rvc-cli #359116

Open
hakan-demirli opened this issue Nov 25, 2024 · 3 comments
Open

Package request: python3Packages.rvc-cli #359116

hakan-demirli opened this issue Nov 25, 2024 · 3 comments
Labels
0.kind: packaging request Request for a new package to be added 6.topic: python

Comments

@hakan-demirli
Copy link
Member

Project description

An easy-to-use CLI Voice Conversion framework.

Metadata


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@hakan-demirli hakan-demirli added 6.topic: python 0.kind: packaging request Request for a new package to be added labels Nov 25, 2024
@hakan-demirli
Copy link
Member Author

hakan-demirli commented Nov 25, 2024

Depends on: #351989 #359108 and #351988

@hakan-demirli
Copy link
Member Author

Following flake environment works:

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixpkgs-unstable";
  };

  outputs =
    {
      self,
      nixpkgs,
      ...
    }@inputs:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs {
        inherit system;
        config.allowUnfree = true;
        #Didn't test this to spare my poor CPU
        #config.cudaSupport = true;
      };
      pedalboard = pkgs.callPackage ./nix/pedalboard.nix { };
      noisereduce = pkgs.callPackage ./nix/noisereduce.nix { };
      local-attention = pkgs.callPackage ./nix/local-attention.nix { };
    in
    {
      devShells.${system}.default =
        let
          pythonEnv = pkgs.python3.withPackages (
            ps: with ps; [
              pip
              distutils

              # Core dependencies
              numpy
              requests
              tqdm
              wget
              pydantic
              fastapi
              starlette

              # Audio processing
              ffmpeg-python
              faiss
              librosa
              pyworld
              scipy
              soundfile
              # praat-parselmouth
              parselmouth
              noisereduce
              pedalboard
              # stftpitchshift

              # Machine learning and deep learning
              numba
              torch
              torchaudio
              torchvision
              torchcrepe
              einops
              # libf0
              transformers

              # Visualization and UI
              matplotlib
              tensorboard
              gradio

              # Miscellaneous utilities
              certifi
              antlr4-python3-runtime
              ffmpy
              tensorboardx
              # edge-tts
              pypresence
              beautifulsoup4
              flask
              local-attention

              # UVR
              samplerate
              six
              pydub
              onnx
              # onnx2torch
              onnxruntime
              julius
              # diffq
              # ml_collections
              resampy
              beartype
              rotary-embedding-torch
            ]
          );
        in
        pkgs.mkShell {
          packages = [ pythonEnv ];
        };
    };
}

@hakan-demirli
Copy link
Member Author

Derivation:

{
  pkgs,
  fetchFromGitHub,
}:

let
  pedalboard = pkgs.callPackage ./pedalboard.nix { };
  noisereduce = pkgs.callPackage ./noisereduce.nix { };
  local-attention = pkgs.callPackage ./local-attention.nix { };
in
pkgs.stdenv.mkDerivation rec {
  pname = "rvc-cli";
  version = "1.0";

  src = fetchFromGitHub {
    owner = "blaisewf";
    repo = "rvc-cli";
    rev = "3c0424dad3d2cca98c6e02d217a0a3cc4632619d";
    sha256 = "sha256-lnxq+nDB0ikT2v6jEWWiH4P54Gl3FH065IKybjJLa38=";
  };

  # Custom install phase to wrap the `rvc_cli.py` script
  installPhase = ''
        mkdir -p $out/bin
        cat <<EOF > $out/bin/rvc_cli
    #!/usr/bin/env bash
    export PYTHONPATH=$PYTHONPATH:${src}
    exec ${pkgs.python3Packages.python.interpreter} ${src}/rvc_cli.py "\$@"
    EOF
        chmod +x $out/bin/rvc_cli
  '';

  # Dependencies for your Python application
  propagatedBuildInputs = with pkgs.python3Packages; [
    distutils
    numpy
    requests
    tqdm
    wget
    pydantic
    fastapi
    starlette
    ffmpeg-python
    faiss
    librosa
    pyworld
    scipy
    soundfile
    parselmouth
    numba
    torch
    torchaudio
    torchvision
    torchcrepe
    einops
    transformers
    matplotlib
    tensorboard
    gradio
    certifi
    antlr4-python3-runtime
    ffmpy
    tensorboardx
    pypresence
    beautifulsoup4
    flask
    samplerate
    six
    pydub
    onnx
    onnxruntime
    julius
    resampy
    beartype
    rotary-embedding-torch
    pedalboard
    noisereduce
    local-attention
  ];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: packaging request Request for a new package to be added 6.topic: python
Projects
None yet
Development

No branches or pull requests

1 participant