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

tts: init at unstable-2020-06-17 #103851

Merged
merged 2 commits into from Dec 1, 2020
Merged

tts: init at unstable-2020-06-17 #103851

merged 2 commits into from Dec 1, 2020

Conversation

mweinelt
Copy link
Member

Motivation for this change

Mozilla TTS is a text to speech engine based on pytorch and tensorflow. @Mic92 and I have been successfully using it for the last few days in combination with https://rhasspy.readthedocs.io, which we might eventually package, not sure yet.

Demo: https://shells.darmstadt.ccc.de/~hexa/nixpkgs.wav

To get this running one needs to download a TTS and Vocoder model, check out https://github.com/mozilla/TTS/wiki/Released-Models, from where we pulled a commit, that matched a given version.

  systemd.services.tts = {
    after = [ "network.target" ];
    wantedBy = [ "multi-user.target" ];
    script = ''
      ${pkgs.tts}/bin/tts-server \
        --vocoder_config ./vocoder/config.json \
        --vocoder_checkpoint ./vocoder/checkpoint_1450000.pth.tar \
        --tts_config ./tts/config.json \
        --tts_checkpoint ./tts/checkpoint_130000.pth.tar
    '';
    serviceConfig = {
      User = "youruser";
      # needed for pulseaudio
      Environment = "XDG_RUNTIME_DIR=/run/user/1000";
      WorkingDirectory = "/path/to/models";
    };
  };

Then reproduce the demo like this:

curl http://localhost:5002/api/tts\\?text\\=Dear%20NixOS%20Maintainer,%20I%20am%20Mozilla%20TTS.%20I%20am%20ready%20to%20be%20merged,%20please%20review%20me\\. > /tmp/nixpkgs.wav
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only nitpicks left.

@mweinelt
Copy link
Member Author

All nitpicks addressed I believe.

@ofborg ofborg bot requested a review from Mic92 November 15, 2020 03:07
@NickHu
Copy link
Contributor

NickHu commented Nov 27, 2020

Perhaps off-topic, but I'd love to see rhasspy packaged - happy to help out too

@mweinelt
Copy link
Member Author

mweinelt commented Nov 27, 2020 via email

@Mic92 Mic92 merged commit ea48cad into NixOS:master Dec 1, 2020
@mweinelt mweinelt deleted the python/tts branch December 1, 2020 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants