Rhasspy 2.5 Pre-Release

The snips nlu has the concept of slot value and synonyms. So you should be able to build this using

"entities": {
    "slot_name": {
      "data": [
        {
          "value": "BAR",
          "synonyms": [
              "foo"
            ]
        },
      ],
      "use_synonyms": true,
      "automatically_extensible": false,
      "matching_strictness": 1.0
    }
  }

https://snips-nlu.readthedocs.io/en/latest/dataset.html#json-format
For more complex converters this might not be applicable -> you might have to go over the results of the snips nlu and run the converter afterwards. I suppose thats what your doing for the other solutions aswell.

2 Likes

Hi all,

First thank you for your great Work!

I want to try Deepspech, but it’s not working. I made fresh install (Docker) on a Raspberry Pi 4 with german Profil. But i get a error ‘TrainingFailedException: CreateModel failed with error code 12288’ after Download the files for Deepspeech. How can handle with this?

Thank you for your help

1 Like

Can you check in the deepspeech directory of your profile and tell me how big the output_graph file is?

Also please let me know the output of this command on the Pi 4:

python3 -c 'import platform; print(platform.machine())'

I’m guessing the Pi 4 reports something other than arm64.

armv7l is the usual for raspbian pi4 Pi3 is just armv7 I think which may cause you probs also zero might report something different but forgot.

1 Like

Its armv71

1 Like

Can you check in the deepspeech directory of your profile and tell me how big the output_graph file is?

it’s 188.939.505 Bytes

python3 -c 'import platform; print(platform.machine())'

armv71

Thank you for your help!

@synesthesiam

I ran into an issue with uploading Slots. Here’s the logging from my code:

04-22 12:08:49 rhasspy.updater.RhasspyUpdater INFO     {"Room": ["Dining", "Kitchen", "Landing", "Guest room", "Study","Backyard"]}
04-22 12:08:49 urllib3.connectionpool DEBUG    Starting new HTTP connection (1): 192.168.178.13:12101
04-22 12:08:49 urllib3.connectionpool DEBUG    http://192.168.178.13:12101 "POST /api/slots?overwrite_all=true HTTP/1.1" 500 44
04-22 12:08:49 rhasspy.updater.RhasspyUpdater ERROR    b"TypeError: 'NoneType' object is not iterable" 

The first line is the content I’m sending to the slots endpoint, the second shows the url, and the last line is a print of response.content (I’m using the requests library in python).

slightly off topic… i recently got the 2.5-pre image running. As i am moving forward with it and have questions ect, should we just put all the 2.5 questions on this thread? or regular posts?

I don’t want to create a bunch of posts regarding 2.5 if we aren’t there yet :slight_smile:

1 Like

for the mqtt option in 2.5. I don’t want to push all my audio frames to an external broker. So i was trying to connect to the internal mqtt. But I can’t connect to it. It seems the mqtt server runs on 127.0.0.1 only. Is there a way to connect directly to the mqtt? or would i be better off spinning up an mqtt docker on the same box and just configure rhasspy to use that one but others can connect at the same time?

Thank!

OK, this makes sense now. The German DeepSpeech model I found did not include a graph for Tensorflow Lite. I’m not sure how to do this, but it’s going to be necessary for running it on a Raspberry Pi.

Make sure to use port 12183. The internal broker doesn’t use the standard MQTT port to avoid conflicting.

Does the Rhasspy log contain any more info (a line number)? I’m not seeing yet where the problem could be.

@synesthesiam

Log contains this:

[ERROR:2020-04-24 21:28:49,248] rhasspyserver_hermes: 'NoneType' object is not iterable
Traceback (most recent call last):
File "/usr/lib/rhasspy-voltron/.venv/lib/python3.7/site-packages/quart/app.py", line 1821, in full_dispatch_request
    result = await self.dispatch_request(request_context)
File "/usr/lib/rhasspy-voltron/.venv/lib/python3.7/site-packages/quart/app.py", line 1869, in dispatch_request
    return await handler(**request_.view_args)
File "/usr/lib/rhasspy-voltron/rhasspy-server-hermes/rhasspyserver_hermes/__main__.py", line 1600, in api_slots
    save_slots(slots_dir, new_slot_values, overwrite_all=overwrite_all)
File "/usr/lib/rhasspy-voltron/rhasspy-server-hermes/rhasspyserver_hermes/__main__.py", line 428, in save_slots
    for name in new_slot_values:
TypeError: 'NoneType' object is not iterable

I’ve had a bit of a look at the code. The old code (2.4.x, app.py) does:

new_slot_values = json5.loads(await request.data)

The new code (rhasspyserver_hermes/main.py) does not do a json.loads():

new_slot_values = await request.json (line 1598)

At first I wasn’t sure if that might work or not, because the request.json() might return a ready-to-use dict, but as an example, in api_slots_by_name, json.loads is used again:

data = await request.data (line 1641)
slot_path = slots_dir / name
slot_values = set(json.loads(data))

So, could that be the problem?

Trying to reproduce this, but failing so far. Is it possible the client is not setting Content-Type to application/json? I could see that causing request.json to return nothing, otherwise I’d expect it to be a dict.

The example from line 1641 should be able to be await request.json as well. In my head, I was accepting a list instead of a JSON object, so I manually parsed it…

Ok, I got it working. Initial docker setup didn’t have the port being passed in to the container. I updated it and now I am able to connect into the mqtt. This is exactly what I needed!

1 Like

That might very well be it. I guess 2.4 was more forgiving. I will check it later today

1 Like

Hi,

I see different updates on rhasspy GitHub, but docker images are still 13 days old.

Any changelog or information why no updates for docker ? Still have a few issues on voltron repo.

:beers:

2 Likes

Hi,
how did you managed, to connect to the mqtt?
Just adding IP and Port of MQTT in setup?

Sorry for the delay. yeah, just need to forward the 12183 in to the container in the docker run, or through portainer or whatever you are using to manage your dockers.

Just a heads up, the virtual environment install for Rhasspy 2.5 has changed a bit.

I’ve created an autoconf script for Rhasspy (./configure) that lets you precisely control which things get installed. This can be something low-level like:

$ ./configure RHASSPY_SPEECH_SYSTEM=kaldi RHASSPY_WAKE_SYSTEM=precise

which will only install Kaldi and Mycroft Precise. Something a bit more high level can also be done:

./configure RHASSPY_LANGUAGE=fr

This will install the “best” speech to text engine for the platform, which is Kaldi unless you’re on a Pi Zero (then pocketsphinx).

Run ./configure --help to see all the options, and please suggest changes!


The new Makefile.in template uses the variable shell scripts in scripts/ to download/install pre-compiled binaries from the new prebuilt-apps repo or actually build them from source (mostly untested).

Going forward, I will be porting the Hermes services to autoconf so they can be configured per-platform. Where possible, each service will have a multi-arch Docker image for Pi 0/1/2/3/4 and amd64.

4 Likes