How to manually install Piper

Thanks Michael, appreciate your work on the project. Not sure what exactly happened, but I re-built a new Docker container, and it works fine just as it did prior to the upgrade. No changes to the existing automations that did include text in the TTS service call.

1 Like

Please can you clarify
Is it possible to install piper and whisper outside HA installation ??
Like on docker containers on a separate NAS ???
Or these 2 containers must run at the same instance HA is running ???

Yes, it’s possible. The easier way is to use official docker image and you can run it on another host if you want, just specify the right IP address and ports when you will configure the integrations.
You can use this working solution based on docker compose or run the containers manually :

@brenard thank you for the prompt reply.
I added all three entries under Wyoming Protocol (whisper, piper, openWakeWord.

Although is the wrong topic, please allow me to tell you my experience.

After I installed the above, I run under /config/voice assistants and I installed a new assistant named Travis. The language is Greek.

Please note that my docker compose file incluses greek language it has been installed properly.

I was pretty excited because I went quiet far…

I also installed Assist Microphone so I could test locally through my PC’s usb microphone.
What a disappointment!

Although Wyoming Protocol procedure run smoothly and I even managed to install docker images as well, the Assist really put me down. It doesn’t work

(when I use Home Assistant cloud it does work!)

But when I switch to the Travis voice assistant which I just created, it doesn’t understand a single word when I type.

(please note that I have add aliases for the specific entity.

When I try to use the microphone it’s a nightmare

I really can’t figure out.
Every body talks about a voice assistant that runs local but you have to install duckdns …

To have good results you have to use a bigger model for whispper :

In french, I start to have good results with the medium-int8 model but it’s take more ressources and more times to handle requests. May be, new models will increase performances in future… :crossed_fingers:

i use this docker file:

version: ‘3’
services:
wyoming-whisper:
image: rhasspy/wyoming-whisper
ports:
- “10300:10300”
volumes:
- ./whisper-data:/data
command: [ “–model”, “medium-int8”, “–language”, “nl” ]
restart: unless-stopped

wyoming-piper:
image: rhasspy/wyoming-piper:latest
container_name: whisper-piper
ports:
- “10200:10200”
volumes:
- ./piper/data:/data
command: [ “–voice”, “nl_BE-nathalie-medium”, " ]
restart: unless-stopped

Hi folks, I’m not sure why but wyoming-whisper (faster-whisper) and wyoming-piper would not initialise for me using docker compose. Both were terminating with “main.py: error: the following arguments are required: --data-dir” when loading the modules:

whisper                 | usage: __main__.py [-h] --uri URI [--zeroconf [ZEROCONF]] [--model MODEL]
whisper                 |                    --data-dir DATA_DIR [--download-dir DOWNLOAD_DIR]
whisper                 |                    [--device DEVICE] [--language LANGUAGE]
whisper                 |                    [--compute-type COMPUTE_TYPE] [--beam-size BEAM_SIZE]
whisper                 |                    [--cpu-threads CPU_THREADS]
whisper                 |                    [--initial-prompt INITIAL_PROMPT]
whisper                 |                    [--stt-library {auto,faster-whisper,transformers,sherpa,onnx-asr}]
whisper                 |                    [--local-files-only] [--debug] [--log-format LOG_FORMAT]
whisper                 |                    [--version]
whisper                 | __main__.py: error: the following arguments are required: --data-dir
whisper exited with code 2 (restarting)

piper           | usage: __main__.py [-h] --voice VOICE [--uri URI] [--zeroconf [ZEROCONF]]
piper           |                    --data-dir DATA_DIR [--download-dir DOWNLOAD_DIR]
piper           |                    [--speaker SPEAKER] [--noise-scale NOISE_SCALE]
piper           |                    [--length-scale LENGTH_SCALE]
piper           |                    [--noise-w-scale NOISE_W_SCALE]
piper           |                    [--auto-punctuation AUTO_PUNCTUATION]
piper           |                    [--samples-per-chunk SAMPLES_PER_CHUNK] [--no-streaming]
piper           |                    [--update-voices] [--use-cuda] [--debug]
piper           |                    [--log-format LOG_FORMAT] [--version]
piper           | __main__.py: error: the following arguments are required: --data-dir
piper exited with code 2

The directories were manually created for both

Versions: (docker container inspect …)
piper: sha256:dcadaef72fce506cc97bc1801042edacf1e4659afbcda675c5dc3505a4bf9bb6
whisper: sha256:3e523d7188489749607b5735282b91116777f5895cbbb16db4073bac65855c3e

The solution for me was to call the service in my docker-compose.yaml with the “–data-dir” parameter set in the command portion for both.

  wyoming-whisper:
    image: rhasspy/wyoming-whisper:latest
    container_name: whisper
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./wyoming-whisper/data:/data
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    #environment:
    # - WHISPER_MODEL:tiny-int8
    # - WHISPER_LANGUAGE:en
    #  - WHISPER_PORT:10300
    command: --model tiny-int8 --language en --data-dir=/data
    ports:
     - "10300:10300"
  wyoming-piper:
    container_name: piper
    image: rhasspy/wyoming-piper
    ports:
      - '10200:10200'
    volumes:
      - ./wyoming-piper/data:/data'
    command: --voice en-gb-southern_english_female-low --data-dir=/data

Maybe it was an error on my side - I’m open to that! Hopefully it helps someone.
@synesthesiam

3 Likes

Thanks for writing this up! This was a breaking change that I didn’t communicate very well. I wanted to make the data directory more obvious so that models weren’t being downloaded into the /data directory inside the container if the user forgot to map it externally.

2 Likes

So should the models directory also be set then?

    volumes:
      - ./wyoming-whisper/data:/data
      - ./wyoming-whisper/models:/share/whisper

Also I don’t use Home Assistant OS or Home Assistant Supervised, so I don’t get the documentation page as part of the app in HA. As a result it’s tricky to then locate the configuration options as they aren’t included on the integration page or on the blog post.

Integration page: Wyoming Protocol - Home Assistant
Blog post: Getting started - Local - Home Assistant

1 Like

Fixed my issue! Thank you kind stranger!

2 Likes

How do you find the voice models under the “command” line? Where can you find reference these for others?