Loading a custom wake word in docker compose

Hi everyone,

I’ve been playing with an Atom Echo and voice assistant. I use a container installation, so I had to make various adjustments to the tutorials, but it’s going well. I have it working with the ‘ok_nabu’ model.

I’ve trained a custom wake word, but I’m having trouble coming up with the docker compose magic to let Open Wake Word find the tflite file. This is what the section of my docker-compose.yml looks like. What’s the docker-compose equivalent of the --custom-model-dir /custom option?

  openwakeword:
    container_name: openwakeword
    image: rhasspy/wyoming-openwakeword
    restart: unless-stopped
    volumes:
      - /media/homeassistant/share/openwakeword:/custom
    depends_on:
      - homeassistant
    ports:
      - '10400:10400'

The basic problem is that I don’t know enough about docker to translate:

docker run -it -p 10400:10400 -v /path/to/custom/models:/custom rhasspy/wyoming-openwakeword \
    --preload-model 'ok_nabu' \
    --custom-model-dir /custom

into docker-compose.yml.

1 Like

As per another thread on here, I’ve added:

command: --preload-model 'ok_nabu' --custom-model-dir /custom

But the custom word isn’t showing up in the list of choices in Settings → Voice Assistant. The file is definitely there.

This is how my docker-compose.yml looks now, after searching more in these forums. Still no luck, though. The hey_casper.tflite file is in the indicated directory, but I don’t see it as a choice when configuring my assist. I probably need to have a config file as well…

  openwakeword:
    container_name: openwakeword
    image: rhasspy/wyoming-openwakeword
    volumes:
      - /media/home_assistant/openwakeword/custom:/custom
      - /media/home_assistant/openwakeword/config:/config
      - /media/home_assistant/openwakework/data:/data
    environment:
      TZ: "Europe/London"
    depends_on:
      - homeassistant
    ports:
      - 10400:10400
      - 10400:10400/udp
    command: --preload-model 'ok_nabu' --custom-model-dir /custom
    restart: unless-stopped

Anyone ever figure this out?

I’ve separated my docker containers for best resource usage, putting my voice assistant wyoming containers on a machine with lots of CPU and a nice GPU, and keeping the rest of home assistant on my older mini PC.

I can’t figure out how to get custom wake words to show up in Home Assistant with this configuration. It only shows the defaults.

Any clues?

It just started working for me a couple of weeks ago. I’m not sure what fixed it, but you can see a typo in my docker compose above (openwork). Here’s my current section, with the typo fixed. I don’t have anything in the config directory.

  openwakeword:
    container_name: openwakeword
    image: rhasspy/wyoming-openwakeword
    volumes:
      - /media/homeassistant/home_assistant/openwakeword/custom:/custom
      - /media/homeassistant/home_assistant/openwakeword/config:/config
      - /media/homeassistant/home_assistant/openwakeword/data:/data
    environment:
      TZ: "Europe/London"
    depends_on:
      - homeassistant
    ports:
      - 10400:10400
      - 10400:10400/udp
    command: --preload-model 'ok_nabu' --custom-model-dir /custom
    restart: unless-stopped
1 Like

For me, I figured out my problem.

Once you add a volume to a docker compose config, you need to recreate the container, not just reload it.

So a simple docker compose up -d to rebuild/restart it picked up the new config and the volume, and then they appeared in Home Assistant.

I’m pretty impressed with the protocol design here, it works very well with the wyoming protocol provider supplying the options and everything. The problem here was just docker admin.

Thanks! Glad yours is working as well.

1 Like

Ah, that’s probably exactly what I did, and didn’t connect the two actions. Thanks!

2 Likes