Skip to content

Setup for rhasspy command script

Daenara edited this page Jan 24, 2021 · 3 revisions

First, you need to setup a command script for rhasspy as described here. I have an example of how this can look here.

Next, you need to clone and install rhasspy_weather in a way that rhasspy itself can use it. I use docker, so I added the folder I cloned rhasspy_weather into as a volume and then used docker exec to open a shell inside my container and did the setup. This has to be repeated after every update of the docker. If rhasspy is installed in a venv, then you have to install rhasspy_weather inside the venv.

The commands I use to install rhasspy_weather are

pip3 install wheel
pip3 install -e RHASSPY_WEATHER_FOLDER

where RHASSPY_WEATHER_FOLDER is the path to wherever you cloned rhasspy_weather into.

After rhasspy_weather is installed you need to generate either slots or slot_programs. To do that you need to execute generate_slots.py.

Since the command script needs rhasspy_weather to be accessible by rhasspy, you can generate slot programs that collect the information used in training directly from the language file of rhasspy_weather. This way, if you add new items and such, they will be included in the next training automatically. To get those slot programs you have to execute generate_slots.py -x. The -x tells the script to generate the slot programs instead of slot files. After generating those files they need to be placed (or symlinked) into a folder called rhasspy_weather in the slot_programs folder of your profile. You also have to make them executable with chmod +x NAME_OF_FILE.

If you want to go with regular slot files instead, just execute generate_slots.py without -x and copy the resulting files into the a new folder called rhasspy_weather inside the slots folder of your profile.

Now that the slots are set up, you need to set up the sentences. I have examples for German and English here. If you want to use the example sentences, either copy the content of the file via web gui or copy the file into a folder called intents in your rhasspy profile.

Now you need to write yourself a configuration file that fits with how you want to use rhasspy_weather. For command script usage the parser should be set to rhasspy_intent and the output to console. You can of course add different outputs also, but console is needed for it to work.

You now should be ready to hit the train button and start to use rhasspy_weather.

Clone this wiki locally