<commit_before>{ lib
, python3
, fetchFromGitHub
, fetchpatch
}:

# USAGE:
# $ tts-server --list_models
# # pick your favorite vocoder/tts model
# $ tts-server --model_name tts_models/en/ljspeech/glow-tts --vocoder_name vocoder_models/universal/libri-tts/fullband-melgan
#
# If you upgrade from an old version you may have to delete old models from ~/.local/share/tts
#
# For now, for deployment check the systemd unit in the pull request:
#   https://github.com/NixOS/nixpkgs/pull/103851#issue-521121136

python3.pkgs.buildPythonApplication rec {
  pname = "tts";
  version = "0.3.0";

  src = fetchFromGitHub {
    owner = "coqui-ai";
    repo = "TTS";
    rev = "v${version}";
    sha256 = "sha256-LiH056h7eIaikBr6sm5A4T/lF7nVroxaZSYzrES7+zk=";
  };

  postPatch = ''
    sed -i requirements.txt \
      -e 's!librosa==[^"]*!librosa!' \
      -e 's!mecab-python3==[^"]*!mecab-python3!' \
      -e 's!numba==[^"]*!numba!' \
      -e 's!numpy==[^"]*!numpy!' \
      -e 's!umap-learn==[^"]*!umap-learn!'
  '';

  nativeBuildInputs = with python3.pkgs; [<commit_msg>tts: 0.3.0 -> 0.3.1<commit_after>{ lib
, python3
, fetchFromGitHub
, fetchpatch
}:

# USAGE:
# $ tts-server --list_models
# # pick your favorite vocoder/tts model
# $ tts-server --model_name tts_models/en/ljspeech/glow-tts --vocoder_name vocoder_models/universal/libri-tts/fullband-melgan
#
# If you upgrade from an old version you may have to delete old models from ~/.local/share/tts
#
# For now, for deployment check the systemd unit in the pull request:
#   https://github.com/NixOS/nixpkgs/pull/103851#issue-521121136

python3.pkgs.buildPythonApplication rec {
  pname = "tts";
  version = "0.3.1";

  src = fetchFromGitHub {
    owner = "coqui-ai";
    repo = "TTS";
    rev = "v${version}";
    sha256 = "sha256-/CeetLm3jgS5Q69zTVkLm+Wh4nD7D4c6j9MTujMc3fU=";
  };

  postPatch = ''
    sed -i requirements.txt \
      -e 's!librosa==[^"]*!librosa!' \
      -e 's!mecab-python3==[^"]*!mecab-python3!' \
      -e 's!numba==[^"]*!numba!' \
      -e 's!numpy==[^"]*!numpy!' \
      -e 's!umap-learn==[^"]*!umap-learn!'
  '';

  nativeBuildInputs = with python3.pkgs; [
{'fraction_non_alphanumeric': 0.175561797752809, 'fraction_numerical': 0.03885767790262172, 'mean_word_length': 3.3701431492842535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '104642', 'n_tokens_mistral': 939, 'n_tokens_neox': 884, 'n_words': 162}