rhasspy | Rhasspy voice assistant for offline home automation
kandi X-RAY | rhasspy Summary
Support
Quality
Security
License
Reuse
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here
rhasspy Key Features
rhasspy Examples and Code Snippets
Trending Discussions on rhasspy
Trending Discussions on rhasspy
QUESTION
Everything runs perfectly fine on my local machine. However when I push my code to GitLab I get the following error:
From GitLab Job viewer
GUI | sh: 1: /usr/src/app/test.startup.sh: Permission denied
GUI exited with code 126
This is my setup:
gui/Dockerfile
#cypress image is needed for automated testing, for production a simple node image is enough
FROM cypress/browsers:node14.16.0-chrome89-ff86
ENV PORT 3000
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package*.json /usr/src/app/
EXPOSE 3000
COPY test.startup.sh /usr/src/app/test.startup.sh
COPY startup.sh /usr/src/app/startup.sh
# the following 4 lines were added to try and solve the problem, they did not. On my local machine it runs fine even without them
RUN chmod 777 /usr
RUN chmod 777 /usr/src
RUN chmod 777 /usr/src/app
RUN chmod 777 /usr/src/app/test.startup.sh
ENTRYPOINT []
docker-compose.testing.yml
version: '3.7'
services:
GUI:
network_mode: host
build: "./gui"
container_name: GUI
volumes:
- "./gui:/usr/src/app"
- /usr/src/app/node_modules
- /usr/src/app/.next
depends_on:
- rhasspy
- rhasspy_de
- rhasspy_adapter
command: sh -c "/usr/src/app/test.startup.sh"
.gitlab-ci.yml
application:
stage: application_test
image: docker
services:
- docker:dind
script:
- apk add --no-cache docker-compose
- docker-compose --file docker-compose.testing.yml build
- docker-compose --file docker-compose.testing.yml up --abort-on-container-exit
I am out of Ideas so any help is greatly appreciated, thank you
ANSWER
Answered 2021-Dec-21 at 22:59In your gitlab-ci.yml
, you use docker-compose (which is bad itself, but not is the subject of the question).
In your docker-compose.yml
you mount gui
directory as /usr/src/app
. So, it does not matter what was in the built image in that directory, all contents will be replaced with contents of gui
directory of git working copy.
To make it work in CI, you need to make sure your script is executable in the git tree. You need to push it as executable.
Example:
~/pipes $ cat gui/test.script.sh
#!/bin/sh
echo "I'm a script"
~/pipes $ ls -l gui/test.script.sh
-rw-rw-r--. 1 test test 32 Dec 22 01:47 gui/test.script.sh
~/pipes $ chmod +x gui/test.script.sh
~/pipes $ ls -l gui/test.script.sh
-rwxrwxr-x. 1 test test 32 Dec 22 01:47 gui/test.script.sh
~/pipes $ git commit gui/test.script.sh -m 'Now executable.'
[feature-123 b524b0d] Now executable.
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 gui/test.script.sh
~/pipes $ git push
QUESTION
I have this simple intent.json file
{
"intents": [
{
"tag": "greeting",
"patterns": [
"Hi",
"How are you",
"Is anyone there?",
"Hello",
"Good day"
],
"responses": [
"Hello"
],
"context_set": ""
},
{
"tag": "goodbye",
"patterns": [
"Bye",
"not interested",
"Goodbye"
],
"responses": [
"ok bye"
]
},
{
"tag": "thanks",
"patterns": [
"Thanks",
"Thank you"
],
"responses": [
"My pleasure"
]
},
{
"tag": "greetiing_exchange",
"patterns": [
"What about you",
"you",
"how about your self"
],
"responses": [
"i am perfect, thanks for asking"
],
"context_set": ""
}
]
}
from fuzzywuzzy import process
for intent in intents['intents']:
Ratios = process.extract(message,intent['patterns'])
for ratio in Ratios:
highest_value = max(Ratios, key = lambda i : i[1])
print(highest_value)
Now i want input from user identify the pattern and output response.
The problem is it is not iterating through every pattern when i input "hi". Its output is ('Hi', 100) ('not interested', 45) ('Thanks', 45) ('What about you', 45)
I want the pattern which is higher in range of 80 to 100, and print response from that pattern
Another thing there is a library Rhasspy which can be used for intent recognition how can i use that library for this file
ANSWER
Answered 2021-Jun-28 at 08:54Use process.extractOne
and score_cutoff
parameter:
from fuzzywuzzy import process
import operator
ratios = []
for idx, intent in enumerate(intents['intents']):
# ratio = process.extractOne(message, intent['patterns'], score_cutoff=80)
# if ratio:
# --- New in python 3.8: walrus operator ---
if ratio := process.extractOne(message, intent['patterns'], score_cutoff=80):
ratios.append((idx, ratio[0], ratio[1]))
responses = intents['intents'] \
[max(ratios, key=operator.itemgetter(2))[0]] \
['responses'] if ratios else []
>>> responses
['Hello']
QUESTION
I'm new to WSL and Linux, but I'm trying to follow installation instructions for rhasspy (https://rhasspy.readthedocs.io/en/latest/installation/#windows-subsystem-for-linux-wsl). I have run the make install
command successfully and the next step says I should copy rhasspy somewhere in my path but I can't quite figure out what copying to path means.
When installation is finished, copy rhasspy.sh somewhere in your PATH and rename it to rhasspy.
I added it to path but nothing changed so I was wondering if there is something I'm doing wrong. Right now when I run rhasspy on wsl it says rhasspy.sh: command not found
. Any help would be really appreciated!
ANSWER
Answered 2020-Aug-05 at 16:26PATH
is an environment variable. When you launch env
, you see the list of known environment variables on your system.
In order to add something to your PATH
variable, you need to take the variable, add the mentioned directory (preceeded by a semi-colon, most probably, as a separator) and store this again as the PATH
variable. This can be done as follows (own example):
export PATH=$PATH:/home/this_user
QUESTION
I have a json file with the following input
{
"Arg":"room=Rhasspy rhasspyName",
"Results": [
{
"Name":"TV",
"Internals": { },
"Readings": { },
"Attributes": { "rhasspyName": "TV" }
},
{
"Name":"dyTest01",
"Internals": { },
"Readings": { },
"Attributes": { "rhasspyName": "radio" }
},
{
"Name":"enoAcPC01",
"Internals": { },
"Readings": { },
"Attributes": { "rhasspyName": "pc" }
} ],
"totalResultsReturned":3
}
With jq '.Results | .[] | .["Attributes"] | .rhasspyName' -r
I can get a list like
TV
radio
pc
How can I take this input and create a new json looking like
{"Devices":["TV","radio","pc"]}
ANSWER
Answered 2020-May-25 at 17:01Put them into an array and pair that with Devices
key in an object.
$ jq '{Devices:[.Results[].Attributes.rhasspyName]}' file
{
"Devices": [
"TV",
"radio",
"pc"
]
}
To create a new file with that JSON value, redirect JQ's stdout to a file, like:
jq '{Devices:[.Results[].Attributes.rhasspyName]}' file > newfile
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rhasspy
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page