Fixing Dockerfiles and examples

This commit is contained in:
Michael Hansen
2019-05-03 15:28:11 -04:00
parent 0215671601
commit d38ac98ce5
32 changed files with 161 additions and 1121 deletions
+15 -27
View File
@@ -36,7 +36,7 @@ trap cleanup EXIT
# Debian dependencies
# -----------------------------------------------------------------------------
echo "Installing system dependencies"
echo "Installing system dependencies (${FRIENDLY_ARCH})"
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-venv python3-dev \
python \
@@ -45,7 +45,8 @@ sudo apt-get install -y python3 python3-pip python3-venv python3-dev \
libatlas-base-dev \
gfortran libfst-dev \
sphinxbase-utils sphinxtrain pocketsphinx \
jq checkinstall unzip xz-utils
jq checkinstall unzip xz-utils \
libfst-dev
# -----------------------------------------------------------------------------
# Python 3.6
@@ -151,23 +152,24 @@ if [[ -z "$(which precise-engine)" ]]; then
fi
# -----------------------------------------------------------------------------
# MITLM
# Opengrm
# -----------------------------------------------------------------------------
if [[ -z "$(which estimate-ngram)" ]]; then
mitlm_file="${download_dir}/mitlm-0.4.2.tar.gz"
if [[ ! -f "${mitlm_file}" ]]; then
mitlm_url='https://github.com/mitlm/mitlm/releases/download/v0.4.2/mitlm-0.4.2.tar.xz'
echo "Download MITLM (${mitlm_url})"
wget -q -O "${mitlm_file}" "${mitlm_url}"
if [[ -z "$(which ngramcount)" ]]; then
opengrm_file="${download_dir}/opengrm-ngram-1.3.3.tar.gz"
if [[ ! -f "${opengrm_file}" ]]; then
opengrm_url='https://www.opengrm.org/twiki/pub/GRM/NGramDownload/opengrm-ngram-1.3.3.tar.gz'
echo "Download Opengrm (${opengrm_url})"
wget -q -O "${opengrm_file}" "${opengrm_url}"
fi
echo "Building MITLM ${mitlm_file}"
tar -C "${temp_dir}" -xf "${mitlm_file}" && \
cd "${temp_dir}/mitlm-0.4.2" && \
echo "Building Opengrm ${opengrm_file}"
tar -C "${temp_dir}" -xf "${opengrm_file}" && \
cd "${temp_dir}/opengrm-ngram-1.3.3" && \
./configure && \
make -j 4 && \
sudo make install
sudo make install && \
sudo ldconfig
fi
# -----------------------------------------------------------------------------
@@ -191,20 +193,6 @@ if [[ -z "$(which phonetisaurus-apply)" ]]; then
*)
# Build from source
openfst_file="${download_dir}/openfst-1.6.2.tar.gz"
if [[ ! -f "${openfst_file}" ]]; then
openfst_url='http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.2.tar.gz'
echo "Downloading OpenFST source (${openfst_url})"
wget -q -O "${openfst_file}" "${openfst_url}"
fi
echo "Building OpenFST (${openfst_file})"
tar -C "${temp_dir}" -xzf "${openfst_file}" && \
cd "${temp_dir}/openfst-1.6.2" && \
./configure --enable-static --enable-shared --enable-far --enable-ngram-fsts && \
make -j 4 && \
sudo make install
phonetisaurus_file="${download_dir}/phonetisaurus-2019.zip"
if [[ ! -f "${phonetisaurus_file}" ]]; then
phonetisaurus_url="https://github.com/synesthesiam/phonetisaurus-2019/releases/download/v1.0/phonetisaurus-2019_${FRIENDLY_ARCH}.deb"
+10 -4
View File
@@ -12,11 +12,17 @@ if [[ -z "${RHASSPY_APP}" ]]; then
fi
fi
if [[ -f "$CONFIG_PATH" ]]; then
if [[ -f "${CONFIG_PATH}" ]]; then
# Hass.IO configuration
RHASSPY_PROFILE="$(jq --raw-output '.default_profile' "${CONFIG_PATH}")"
RHASSPY_ARGS="--profile \"${RHASSPY_PROFILE}\""
profile_name="$(jq --raw-output '.profile_name' "${CONFIG_PATH}")"
profile_dir="$(jq --raw-output '.profile_dir' "${CONFIG_PATH}")"
RHASSPY_ARGS="--profile \"${profile_name}\" --user-profiles \"${profile_dir}\""
fi
cd "${RHASSPY_APP}"
python3 app.py "${RHASSPY_ARGS}" "$@"
if [[ -z "${RHASSPY_ARGS}" ]]; then
python3 app.py "$@"
else
python3 app.py "${RHASSPY_ARGS}" "$@"
fi
+1 -3
View File
@@ -16,14 +16,12 @@ SYSTEM_DEPENDENCIES
PHONETISAURUS
MITLM
OPENGRM
PYTHON_REQUIREMENTS
PYTHON_POCKETSPHINX
PYJSGF
SNOWBOY
MYCROFT_PRECISE
@@ -39,17 +39,24 @@ RUN cd /phonetisaurus && \
make install && \
rm -rf /phonetisaurus*
# Install mitlm
RUN apt-get install -y gfortran
COPY download/mitlm-0.4.2.tar.xz /
RUN cd / && tar -xf mitlm-0.4.2.tar.xz && cd mitlm-0.4.2/ && \
# Install Opengrm
RUN apt-get install -y libfst-dev
COPY download/opengrm-ngram-1.3.3.tar.gz /
RUN cd / && tar -xf opengrm-ngram-1.3.3.tar.gz && \
cd opengrm-ngram-1.3.3 && \
./configure && \
make -j $MAKE_THREADS && \
make install && \
rm -rf /mitlm-0.4.2*
ldconfig && \
rm -rf /opengrm*
# Install Python dependencies
RUN python3 -m pip install --no-cache-dir wheel
COPY download/pyjsgf-1.6.0.tar.gz \
download/jsgf2fst-0.1.0.tar.gz \
/download/
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
@@ -58,11 +65,6 @@ COPY download/pocketsphinx-python.tar.gz /
RUN python3 -m pip install --no-cache-dir /pocketsphinx-python.tar.gz && \
rm -rf /pocketsphinx-python*
# Install fixed PyJSGF library
COPY download/pyjsgf-1.5.1.tar.gz /
RUN python3 -m pip install /pyjsgf-1.5.1.tar.gz && \
rm /pyjsgf-1.5.1.tar.gz
# Install snowboy
COPY download/snowboy-1.3.0.tar.gz /
RUN if [ "$BUILD_ARCH" != "aarch64" ]; then pip3 install --no-cache-dir /snowboy-1.3.0.tar.gz; fi
@@ -39,17 +39,24 @@ RUN cd /phonetisaurus && \
make install && \
rm -rf /phonetisaurus*
# Install mitlm
RUN apt-get install -y gfortran
COPY download/mitlm-0.4.2.tar.xz /
RUN cd / && tar -xf mitlm-0.4.2.tar.xz && cd mitlm-0.4.2/ && \
# Install Opengrm
RUN apt-get install -y libfst-dev
COPY download/opengrm-ngram-1.3.3.tar.gz /
RUN cd / && tar -xf opengrm-ngram-1.3.3.tar.gz && \
cd opengrm-ngram-1.3.3 && \
./configure && \
make -j $MAKE_THREADS && \
make install && \
rm -rf /mitlm-0.4.2*
ldconfig && \
rm -rf /opengrm*
# Install Python dependencies
RUN python3 -m pip install --no-cache-dir wheel
COPY download/pyjsgf-1.6.0.tar.gz \
download/jsgf2fst-0.1.0.tar.gz \
/download/
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
@@ -58,11 +65,6 @@ COPY download/pocketsphinx-python.tar.gz /
RUN python3 -m pip install --no-cache-dir /pocketsphinx-python.tar.gz && \
rm -rf /pocketsphinx-python*
# Install fixed PyJSGF library
COPY download/pyjsgf-1.5.1.tar.gz /
RUN python3 -m pip install /pyjsgf-1.5.1.tar.gz && \
rm /pyjsgf-1.5.1.tar.gz
# Install snowboy
COPY download/snowboy-1.3.0.tar.gz /
RUN if [ "$BUILD_ARCH" != "aarch64" ]; then pip3 install --no-cache-dir /snowboy-1.3.0.tar.gz; fi
@@ -39,17 +39,24 @@ RUN cd /phonetisaurus && \
make install && \
rm -rf /phonetisaurus*
# Install mitlm
RUN apt-get install -y gfortran
COPY download/mitlm-0.4.2.tar.xz /
RUN cd / && tar -xf mitlm-0.4.2.tar.xz && cd mitlm-0.4.2/ && \
# Install Opengrm
RUN apt-get install -y libfst-dev
COPY download/opengrm-ngram-1.3.3.tar.gz /
RUN cd / && tar -xf opengrm-ngram-1.3.3.tar.gz && \
cd opengrm-ngram-1.3.3 && \
./configure && \
make -j $MAKE_THREADS && \
make install && \
rm -rf /mitlm-0.4.2*
ldconfig && \
rm -rf /opengrm*
# Install Python dependencies
RUN python3 -m pip install --no-cache-dir wheel
COPY download/pyjsgf-1.6.0.tar.gz \
download/jsgf2fst-0.1.0.tar.gz \
/download/
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
@@ -58,11 +65,6 @@ COPY download/pocketsphinx-python.tar.gz /
RUN python3 -m pip install --no-cache-dir /pocketsphinx-python.tar.gz && \
rm -rf /pocketsphinx-python*
# Install fixed PyJSGF library
COPY download/pyjsgf-1.5.1.tar.gz /
RUN python3 -m pip install /pyjsgf-1.5.1.tar.gz && \
rm /pyjsgf-1.5.1.tar.gz
# Install snowboy
COPY download/snowboy-1.3.0.tar.gz /
RUN if [ "$BUILD_ARCH" != "aarch64" ]; then pip3 install --no-cache-dir /snowboy-1.3.0.tar.gz; fi
@@ -26,17 +26,24 @@ COPY download/phonetisaurus-2019_${BUILD_ARCH}.deb /phonetisaurus.deb
RUN dpkg -i /phonetisaurus.deb && \
rm /phonetisaurus.deb
# Install mitlm
RUN apt-get install -y gfortran
COPY download/mitlm-0.4.2.tar.xz /
RUN cd / && tar -xf mitlm-0.4.2.tar.xz && cd mitlm-0.4.2/ && \
# Install Opengrm
RUN apt-get install -y libfst-dev
COPY download/opengrm-ngram-1.3.3.tar.gz /
RUN cd / && tar -xf opengrm-ngram-1.3.3.tar.gz && \
cd opengrm-ngram-1.3.3 && \
./configure && \
make -j $MAKE_THREADS && \
make install && \
rm -rf /mitlm-0.4.2*
ldconfig && \
rm -rf /opengrm*
# Install Python dependencies
RUN python3 -m pip install --no-cache-dir wheel
COPY download/pyjsgf-1.6.0.tar.gz \
download/jsgf2fst-0.1.0.tar.gz \
/download/
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
@@ -45,11 +52,6 @@ COPY download/pocketsphinx-python.tar.gz /
RUN python3 -m pip install --no-cache-dir /pocketsphinx-python.tar.gz && \
rm -rf /pocketsphinx-python*
# Install fixed PyJSGF library
COPY download/pyjsgf-1.5.1.tar.gz /
RUN python3 -m pip install /pyjsgf-1.5.1.tar.gz && \
rm /pyjsgf-1.5.1.tar.gz
# Install snowboy
COPY download/snowboy-1.3.0.tar.gz /
RUN if [ "$BUILD_ARCH" != "aarch64" ]; then pip3 install --no-cache-dir /snowboy-1.3.0.tar.gz; fi
@@ -26,17 +26,24 @@ COPY download/phonetisaurus-2019_${BUILD_ARCH}.deb /phonetisaurus.deb
RUN dpkg -i /phonetisaurus.deb && \
rm /phonetisaurus.deb
# Install mitlm
RUN apt-get install -y gfortran
COPY download/mitlm-0.4.2.tar.xz /
RUN cd / && tar -xf mitlm-0.4.2.tar.xz && cd mitlm-0.4.2/ && \
# Install Opengrm
RUN apt-get install -y libfst-dev
COPY download/opengrm-ngram-1.3.3.tar.gz /
RUN cd / && tar -xf opengrm-ngram-1.3.3.tar.gz && \
cd opengrm-ngram-1.3.3 && \
./configure && \
make -j $MAKE_THREADS && \
make install && \
rm -rf /mitlm-0.4.2*
ldconfig && \
rm -rf /opengrm*
# Install Python dependencies
RUN python3 -m pip install --no-cache-dir wheel
COPY download/pyjsgf-1.6.0.tar.gz \
download/jsgf2fst-0.1.0.tar.gz \
/download/
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
@@ -45,11 +52,6 @@ COPY download/pocketsphinx-python.tar.gz /
RUN python3 -m pip install --no-cache-dir /pocketsphinx-python.tar.gz && \
rm -rf /pocketsphinx-python*
# Install fixed PyJSGF library
COPY download/pyjsgf-1.5.1.tar.gz /
RUN python3 -m pip install /pyjsgf-1.5.1.tar.gz && \
rm /pyjsgf-1.5.1.tar.gz
# Install snowboy
COPY download/snowboy-1.3.0.tar.gz /
RUN if [ "$BUILD_ARCH" != "aarch64" ]; then pip3 install --no-cache-dir /snowboy-1.3.0.tar.gz; fi
@@ -26,17 +26,24 @@ COPY download/phonetisaurus-2019_${BUILD_ARCH}.deb /phonetisaurus.deb
RUN dpkg -i /phonetisaurus.deb && \
rm /phonetisaurus.deb
# Install mitlm
RUN apt-get install -y gfortran
COPY download/mitlm-0.4.2.tar.xz /
RUN cd / && tar -xf mitlm-0.4.2.tar.xz && cd mitlm-0.4.2/ && \
# Install Opengrm
RUN apt-get install -y libfst-dev
COPY download/opengrm-ngram-1.3.3.tar.gz /
RUN cd / && tar -xf opengrm-ngram-1.3.3.tar.gz && \
cd opengrm-ngram-1.3.3 && \
./configure && \
make -j $MAKE_THREADS && \
make install && \
rm -rf /mitlm-0.4.2*
ldconfig && \
rm -rf /opengrm*
# Install Python dependencies
RUN python3 -m pip install --no-cache-dir wheel
COPY download/pyjsgf-1.6.0.tar.gz \
download/jsgf2fst-0.1.0.tar.gz \
/download/
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
@@ -45,11 +52,6 @@ COPY download/pocketsphinx-python.tar.gz /
RUN python3 -m pip install --no-cache-dir /pocketsphinx-python.tar.gz && \
rm -rf /pocketsphinx-python*
# Install fixed PyJSGF library
COPY download/pyjsgf-1.5.1.tar.gz /
RUN python3 -m pip install /pyjsgf-1.5.1.tar.gz && \
rm /pyjsgf-1.5.1.tar.gz
# Install snowboy
COPY download/snowboy-1.3.0.tar.gz /
RUN if [ "$BUILD_ARCH" != "aarch64" ]; then pip3 install --no-cache-dir /snowboy-1.3.0.tar.gz; fi
+10
View File
@@ -0,0 +1,10 @@
# Install Opengrm
RUN apt-get install -y libfst-dev
COPY download/opengrm-ngram-1.3.3.tar.gz /
RUN cd / && tar -xf opengrm-ngram-1.3.3.tar.gz && \
cd opengrm-ngram-1.3.3 && \
./configure && \
make -j $MAKE_THREADS && \
make install && \
ldconfig && \
rm -rf /opengrm*
@@ -1,4 +1,9 @@
# Install Python dependencies
RUN python3 -m pip install --no-cache-dir wheel
COPY download/pyjsgf-1.6.0.tar.gz \
download/jsgf2fst-0.1.0.tar.gz \
/download/
COPY requirements.txt /requirements.txt
RUN python3 -m pip install --no-cache-dir -r /requirements.txt
+8 -6
View File
@@ -64,14 +64,16 @@ do
done
# -----------------------------------------------------------------------------
# MITLM
# Opengrm
# -----------------------------------------------------------------------------
mitlm_file="${download_dir}/mitlm-0.4.2.tar.gz"
if [[ ! -f "${mitlm_file}" ]]; then
mitlm_url='https://github.com/mitlm/mitlm/releases/download/v0.4.2/mitlm-0.4.2.tar.xz'
echo "Download MITLM (${mitlm_url})"
wget -q -O "${mitlm_file}" "${mitlm_url}"
if [[ -z "$(which ngramcount)" ]]; then
opengrm_file="${download_dir}/opengrm-ngram-1.3.3.tar.gz"
if [[ ! -f "${opengrm_file}" ]]; then
opengrm_url='https://www.opengrm.org/twiki/pub/GRM/NGramDownload/opengrm-ngram-1.3.3.tar.gz'
echo "Download Opengrm (${opengrm_url})"
wget -q -O "${opengrm_file}" "${opengrm_url}"
fi
fi
# -----------------------------------------------------------------------------
@@ -1,139 +0,0 @@
{
"command": {
"system": "webrtcvad",
"webrtcvad": {
"chunk_size": 960,
"min_sec": 2,
"sample_rate": 16000,
"silence_sec": 0.5,
"speech_buffers": 5,
"throwaway_buffers": 10,
"timeout_sec": 30,
"vad_mode": 0
}
},
"home_assistant": {
"access_token": "",
"api_password": "",
"event_type_format": "rhasspy_{0}",
"url": "http://hassio/homeassistant/"
},
"intent": {
"adapt": {
"stop_words": "stop_words.txt"
},
"fuzzywuzzy": {
"examples_json": "intent_examples.json"
},
"rasa": {
"examples_markdown": "intent_examples.md",
"project_name": "rhasspy",
"url": "http://localhost:5000/"
},
"remote": {
"url": "http://my-server:12101/api/text-to-intent"
},
"system": "fuzzywuzzy"
},
"language": "en",
"microphone": {
"pyaudio": {
"frames_per_buffer": 480
},
"system": "pyaudio"
},
"mqtt": {
"enabled": false,
"host": "localhost",
"password": "",
"port": 1883,
"reconnect_sec": 5,
"site_id": "default",
"username": ""
},
"rhasspy": {
"default_profile": "en",
"listen_on_start": true,
"load_timeout_sec": 15,
"preload_profile": true
},
"sounds": {
"recorded": "etc/wav/beep_lo.wav",
"system": "aplay",
"wake": "etc/wav/beep_hi.wav"
},
"speech_to_text": {
"g2p_model": "g2p.fst",
"grammars_dir": "grammars",
"pocketsphinx": {
"acoustic_model": "acoustic_model",
"base_dictionary": "base_dictionary.txt",
"custom_words": "custom_words.txt",
"dictionary": "dictionary.txt",
"language_model": "language_model.txt",
"mllr_matrix": "acoustic_model_mllr",
"unknown_words": "unknown_words.txt"
},
"remote": {
"url": "http://my-server:12101/api/speech-to-text"
},
"sentences_ini": "sentences.ini",
"sentences_text": "sentences.txt",
"slots_dir": "slots",
"system": "pocketsphinx"
},
"text_to_speech": {
"espeak": {
"phoneme_map": "espeak_phonemes.txt"
},
"phoneme_examples": "phoneme_examples.txt",
"system": "espeak"
},
"training": {
"balance_sentences": true,
"regex": {
"replace": [
{
"'s": "s"
},
{
"[^\\w ]+": " "
}
],
"split": "\\s+"
},
"sentence_casing": "lower",
"tagged_sentences": "tagged_sentences.md",
"tokenizer": "regex"
},
"tuning": {
"sphinxtrain": {
"mllr_matrix": "acoustic_model_mllr"
},
"system": "sphinxtrain"
},
"wake": {
"hermes": {
"wakeword_id": "default"
},
"pocketsphinx": {
"chunk_size": 960,
"keyphrase": "okay rhasspy",
"mllr_matrix": "wake_mllr",
"threshold": 1e-30
},
"precise": {
"chunk_size": 2048,
"model": "okay-rhasspy.pb",
"sensitivity": 0.5,
"trigger_level": 3
},
"snowboy": {
"audio_gain": 1,
"chunk_size": 960,
"model": "snowboy.umdl",
"sensitivity": 0.5
},
"system": "pocketsphinx"
}
}
+2 -4
View File
@@ -2,22 +2,20 @@ version: '2'
services:
server:
image: synesthesiam/rhasspy-server:latest
environment:
- RHASSPY_PROFILES=/profiles
volumes:
- ./server/profiles:/profiles
ports:
- "13202:12101"
command: --profile en --user-profiles /profiles
client:
image: synesthesiam/rhasspy-server:latest
environment:
- RHASSPY_PROFILES=/profiles
volumes:
- ./client/profiles:/profiles
devices:
- /dev/snd:/dev/snd
ports:
- "12101:12101"
command: --profile en --user-profiles /profiles
hass:
image: homeassistant/home-assistant
volumes:
@@ -1,139 +0,0 @@
{
"command": {
"system": "webrtcvad",
"webrtcvad": {
"chunk_size": 960,
"min_sec": 2,
"sample_rate": 16000,
"silence_sec": 0.5,
"speech_buffers": 5,
"throwaway_buffers": 10,
"timeout_sec": 30,
"vad_mode": 0
}
},
"home_assistant": {
"access_token": "",
"api_password": "",
"event_type_format": "rhasspy_{0}",
"url": "http://hassio/homeassistant/"
},
"intent": {
"adapt": {
"stop_words": "stop_words.txt"
},
"fuzzywuzzy": {
"examples_json": "intent_examples.json"
},
"rasa": {
"examples_markdown": "intent_examples.md",
"project_name": "rhasspy",
"url": "http://localhost:5000/"
},
"remote": {
"url": "http://my-server:12101/api/text-to-intent"
},
"system": "fuzzywuzzy"
},
"language": "en",
"microphone": {
"pyaudio": {
"frames_per_buffer": 480
},
"system": "pyaudio"
},
"mqtt": {
"enabled": false,
"host": "localhost",
"password": "",
"port": 1883,
"reconnect_sec": 5,
"site_id": "default",
"username": ""
},
"rhasspy": {
"default_profile": "en",
"listen_on_start": true,
"load_timeout_sec": 15,
"preload_profile": true
},
"sounds": {
"recorded": "etc/wav/beep_lo.wav",
"system": "aplay",
"wake": "etc/wav/beep_hi.wav"
},
"speech_to_text": {
"g2p_model": "g2p.fst",
"grammars_dir": "grammars",
"pocketsphinx": {
"acoustic_model": "acoustic_model",
"base_dictionary": "base_dictionary.txt",
"custom_words": "custom_words.txt",
"dictionary": "dictionary.txt",
"language_model": "language_model.txt",
"mllr_matrix": "acoustic_model_mllr",
"unknown_words": "unknown_words.txt"
},
"remote": {
"url": "http://my-server:12101/api/speech-to-text"
},
"sentences_ini": "sentences.ini",
"sentences_text": "sentences.txt",
"slots_dir": "slots",
"system": "pocketsphinx"
},
"text_to_speech": {
"espeak": {
"phoneme_map": "espeak_phonemes.txt"
},
"phoneme_examples": "phoneme_examples.txt",
"system": "espeak"
},
"training": {
"balance_sentences": true,
"regex": {
"replace": [
{
"'s": "s"
},
{
"[^\\w ]+": " "
}
],
"split": "\\s+"
},
"sentence_casing": "lower",
"tagged_sentences": "tagged_sentences.md",
"tokenizer": "regex"
},
"tuning": {
"sphinxtrain": {
"mllr_matrix": "acoustic_model_mllr"
},
"system": "sphinxtrain"
},
"wake": {
"hermes": {
"wakeword_id": "default"
},
"pocketsphinx": {
"chunk_size": 960,
"keyphrase": "okay rhasspy",
"mllr_matrix": "wake_mllr",
"threshold": 1e-30
},
"precise": {
"chunk_size": 2048,
"model": "okay-rhasspy.pb",
"sensitivity": 0.5,
"trigger_level": 3
},
"snowboy": {
"audio_gain": 1,
"chunk_size": 960,
"model": "snowboy.umdl",
"sensitivity": 0.5
},
"system": "pocketsphinx"
}
}
+1 -2
View File
@@ -2,11 +2,10 @@ version: '2'
services:
rhasspy:
image: synesthesiam/rhasspy-server:latest
environment:
- RHASSPY_PROFILES=/profiles
volumes:
- ./rhasspy/profiles:/profiles
devices:
- /dev/snd:/dev/snd
ports:
- "12101:12101"
command: --profile en --user-profiles /profiles
@@ -1,181 +0,0 @@
{
"command": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/listen.sh"
},
"oneshot": {
"timeout_sec": 30
},
"system": "webrtcvad",
"webrtcvad": {
"chunk_size": 960,
"min_sec": 2,
"sample_rate": 16000,
"silence_sec": 0.5,
"speech_buffers": 5,
"throwaway_buffers": 10,
"timeout_sec": 30,
"vad_mode": 0
}
},
"handle": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/handle.sh"
},
"forward_to_hass": true,
"system": "hass"
},
"home_assistant": {
"access_token": "",
"api_password": "",
"event_type_format": "rhasspy_{0}",
"url": "http://hassio/homeassistant/"
},
"intent": {
"adapt": {
"stop_words": "stop_words.txt"
},
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/text2intent.sh"
},
"fuzzywuzzy": {
"examples_json": "intent_examples.json"
},
"rasa": {
"examples_markdown": "intent_examples.md",
"project_name": "rhasspy",
"url": "http://localhost:5000/"
},
"remote": {
"url": "http://my-server:12101/api/text-to-intent"
},
"system": "fuzzywuzzy"
},
"language": "en",
"microphone": {
"pyaudio": {
"frames_per_buffer": 480
},
"system": "pyaudio"
},
"mqtt": {
"enabled": false,
"host": "localhost",
"password": "",
"port": 1883,
"publish_intents": true,
"reconnect_sec": 5,
"site_id": "default",
"username": ""
},
"rhasspy": {
"default_profile": "en",
"listen_on_start": true,
"load_timeout_sec": 15,
"preload_profile": true
},
"sounds": {
"recorded": "etc/wav/beep_lo.wav",
"system": "aplay",
"wake": "etc/wav/beep_hi.wav"
},
"speech_to_text": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/speech2text.sh"
},
"g2p_model": "g2p.fst",
"grammars_dir": "grammars",
"pocketsphinx": {
"acoustic_model": "acoustic_model",
"base_dictionary": "base_dictionary.txt",
"custom_words": "custom_words.txt",
"dictionary": "dictionary.txt",
"language_model": "language_model.txt",
"mllr_matrix": "acoustic_model_mllr",
"unknown_words": "unknown_words.txt"
},
"remote": {
"url": "http://my-server:12101/api/speech-to-text"
},
"sentences_ini": "sentences.ini",
"sentences_text": "sentences.txt",
"slots_dir": "slots",
"system": "pocketsphinx"
},
"text_to_speech": {
"espeak": {
"phoneme_map": "espeak_phonemes.txt"
},
"phoneme_examples": "phoneme_examples.txt",
"system": "espeak"
},
"training": {
"balance_sentences": true,
"intent": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/train-intent.sh"
},
"system": "auto"
},
"regex": {
"replace": [
{
"'s": "s"
},
{
"[^\\w ]+": " "
}
],
"split": "\\s+"
},
"sentence_casing": "lower",
"speech_to_text": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/train-stt.sh"
},
"system": "auto"
},
"tagged_sentences": "tagged_sentences.md",
"tokenizer": "regex"
},
"tuning": {
"sphinxtrain": {
"mllr_matrix": "acoustic_model_mllr"
},
"system": "sphinxtrain"
},
"wake": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/sleep.sh"
},
"hermes": {
"wakeword_id": "default"
},
"pocketsphinx": {
"chunk_size": 960,
"keyphrase": "okay rhasspy",
"mllr_matrix": "wake_mllr",
"threshold": 1e-30
},
"precise": {
"chunk_size": 2048,
"model": "okay-rhasspy.pb",
"sensitivity": 0.5,
"trigger_level": 3
},
"snowboy": {
"audio_gain": 1,
"chunk_size": 960,
"model": "snowboy.umdl",
"sensitivity": 0.5
},
"system": "pocketsphinx"
}
}
+1 -9
View File
@@ -6,14 +6,6 @@ export LANG=C.UTF-8
# Directory of *this* script
DIR="$( cd "$( dirname "$0" )" && pwd )"
export RHASSPY_PROFILES="$RHASSPY_PROFILES:$DIR/rhasspy/profiles"
if [[ -z "$RHASSPY_PORT" ]]; then
export RHASSPY_PORT=12101
fi
cd "$DIR/../../"
source .venv/bin/activate
export FLASK_APP=app.py
export RHASSPY_ARGS="$@"
flask run --host=0.0.0.0 --port=$RHASSPY_PORT
python3 app.py "$@"
@@ -1,184 +0,0 @@
{
"command": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/listen.sh"
},
"oneshot": {
"timeout_sec": 30
},
"system": "webrtcvad",
"webrtcvad": {
"chunk_size": 960,
"min_sec": 2,
"sample_rate": 16000,
"silence_sec": 0.5,
"speech_buffers": 5,
"throwaway_buffers": 10,
"timeout_sec": 30,
"vad_mode": 0
}
},
"handle": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/handle.sh"
},
"forward_to_hass": true,
"system": "hass"
},
"home_assistant": {
"access_token": "",
"api_password": "",
"event_type_format": "rhasspy_{0}",
"url": "http://hassio/homeassistant/"
},
"intent": {
"adapt": {
"stop_words": "stop_words.txt"
},
"command": {
"arguments": [
"ChangeLightState",
"living room lamp",
"on"
],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/text2intent.sh"
},
"fuzzywuzzy": {
"examples_json": "intent_examples.json"
},
"rasa": {
"examples_markdown": "intent_examples.md",
"project_name": "rhasspy",
"url": "http://localhost:5000/"
},
"remote": {
"url": "http://my-server:12101/api/text-to-intent"
},
"system": "fuzzywuzzy"
},
"language": "en",
"microphone": {
"pyaudio": {
"frames_per_buffer": 480
},
"system": "pyaudio"
},
"mqtt": {
"enabled": false,
"host": "localhost",
"password": "",
"port": 1883,
"reconnect_sec": 5,
"site_id": "default",
"username": ""
},
"rhasspy": {
"default_profile": "en",
"listen_on_start": true,
"load_timeout_sec": 15,
"preload_profile": true
},
"sounds": {
"recorded": "etc/wav/beep_lo.wav",
"system": "aplay",
"wake": "etc/wav/beep_hi.wav"
},
"speech_to_text": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/speech2text.sh"
},
"g2p_model": "g2p.fst",
"grammars_dir": "grammars",
"pocketsphinx": {
"acoustic_model": "acoustic_model",
"base_dictionary": "base_dictionary.txt",
"custom_words": "custom_words.txt",
"dictionary": "dictionary.txt",
"language_model": "language_model.txt",
"mllr_matrix": "acoustic_model_mllr",
"unknown_words": "unknown_words.txt"
},
"remote": {
"url": "http://my-server:12101/api/speech-to-text"
},
"sentences_ini": "sentences.ini",
"sentences_text": "sentences.txt",
"slots_dir": "slots",
"system": "pocketsphinx"
},
"text_to_speech": {
"espeak": {
"phoneme_map": "espeak_phonemes.txt"
},
"phoneme_examples": "phoneme_examples.txt",
"system": "espeak"
},
"training": {
"balance_sentences": true,
"intent": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/train-intent.sh"
},
"system": "auto"
},
"regex": {
"replace": [
{
"'s": "s"
},
{
"[^\\w ]+": " "
}
],
"split": "\\s+"
},
"sentence_casing": "lower",
"speech_to_text": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/train-stt.sh"
},
"system": "auto"
},
"tagged_sentences": "tagged_sentences.md",
"tokenizer": "regex"
},
"tuning": {
"sphinxtrain": {
"mllr_matrix": "acoustic_model_mllr"
},
"system": "sphinxtrain"
},
"wake": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/sleep.sh"
},
"hermes": {
"wakeword_id": "default"
},
"pocketsphinx": {
"chunk_size": 960,
"keyphrase": "okay rhasspy",
"mllr_matrix": "wake_mllr",
"threshold": 1e-30
},
"precise": {
"chunk_size": 2048,
"model": "okay-rhasspy.pb",
"sensitivity": 0.5,
"trigger_level": 3
},
"snowboy": {
"audio_gain": 1,
"chunk_size": 960,
"model": "snowboy.umdl",
"sensitivity": 0.5
},
"system": "pocketsphinx"
}
}
+1 -9
View File
@@ -6,14 +6,6 @@ export LANG=C.UTF-8
# Directory of *this* script
DIR="$( cd "$( dirname "$0" )" && pwd )"
export RHASSPY_PROFILES="$RHASSPY_PROFILES:$DIR/rhasspy/profiles"
if [[ -z "$RHASSPY_PORT" ]]; then
export RHASSPY_PORT=12101
fi
cd "$DIR/../../"
source .venv/bin/activate
export FLASK_APP=app.py
export RHASSPY_ARGS="$@"
flask run --host=0.0.0.0 --port=$RHASSPY_PORT
python3 -m app.py "$@"
+1 -2
View File
@@ -2,14 +2,13 @@ version: '2'
services:
rhasspy:
image: synesthesiam/rhasspy-server:latest
environment:
- RHASSPY_PROFILES=/profiles
volumes:
- ./rhasspy/profiles:/profiles
devices:
- /dev/snd:/dev/snd
ports:
- "12101:12101"
command: --profile en --user-profiles /profiles
hass:
image: homeassistant/home-assistant
volumes:
@@ -1,139 +0,0 @@
{
"command": {
"system": "webrtcvad",
"webrtcvad": {
"chunk_size": 960,
"min_sec": 2,
"sample_rate": 16000,
"silence_sec": 0.5,
"speech_buffers": 5,
"throwaway_buffers": 10,
"timeout_sec": 30,
"vad_mode": 0
}
},
"home_assistant": {
"access_token": "",
"api_password": "",
"event_type_format": "rhasspy_{0}",
"url": "http://hassio/homeassistant/"
},
"intent": {
"adapt": {
"stop_words": "stop_words.txt"
},
"fuzzywuzzy": {
"examples_json": "intent_examples.json"
},
"rasa": {
"examples_markdown": "intent_examples.md",
"project_name": "rhasspy",
"url": "http://localhost:5000/"
},
"remote": {
"url": "http://my-server:12101/api/text-to-intent"
},
"system": "fuzzywuzzy"
},
"language": "en",
"microphone": {
"pyaudio": {
"frames_per_buffer": 480
},
"system": "pyaudio"
},
"mqtt": {
"enabled": false,
"host": "localhost",
"password": "",
"port": 1883,
"reconnect_sec": 5,
"site_id": "default",
"username": ""
},
"rhasspy": {
"default_profile": "en",
"listen_on_start": true,
"load_timeout_sec": 15,
"preload_profile": true
},
"sounds": {
"recorded": "etc/wav/beep_lo.wav",
"system": "aplay",
"wake": "etc/wav/beep_hi.wav"
},
"speech_to_text": {
"g2p_model": "g2p.fst",
"grammars_dir": "grammars",
"pocketsphinx": {
"acoustic_model": "acoustic_model",
"base_dictionary": "base_dictionary.txt",
"custom_words": "custom_words.txt",
"dictionary": "dictionary.txt",
"language_model": "language_model.txt",
"mllr_matrix": "acoustic_model_mllr",
"unknown_words": "unknown_words.txt"
},
"remote": {
"url": "http://my-server:12101/api/speech-to-text"
},
"sentences_ini": "sentences.ini",
"sentences_text": "sentences.txt",
"slots_dir": "slots",
"system": "pocketsphinx"
},
"text_to_speech": {
"espeak": {
"phoneme_map": "espeak_phonemes.txt"
},
"phoneme_examples": "phoneme_examples.txt",
"system": "espeak"
},
"training": {
"balance_sentences": true,
"regex": {
"replace": [
{
"'s": "s"
},
{
"[^\\w ]+": " "
}
],
"split": "\\s+"
},
"sentence_casing": "lower",
"tagged_sentences": "tagged_sentences.md",
"tokenizer": "regex"
},
"tuning": {
"sphinxtrain": {
"mllr_matrix": "acoustic_model_mllr"
},
"system": "sphinxtrain"
},
"wake": {
"hermes": {
"wakeword_id": "default"
},
"pocketsphinx": {
"chunk_size": 960,
"keyphrase": "okay rhasspy",
"mllr_matrix": "wake_mllr",
"threshold": 1e-30
},
"precise": {
"chunk_size": 2048,
"model": "okay-rhasspy.pb",
"sensitivity": 0.5,
"trigger_level": 3
},
"snowboy": {
"audio_gain": 1,
"chunk_size": 960,
"model": "snowboy.umdl",
"sensitivity": 0.5
},
"system": "pocketsphinx"
}
}
+2 -3
View File
@@ -3,14 +3,13 @@ services:
rhasspy:
image: synesthesiam/rhasspy-server:latest
network_mode: "host"
environment:
- RHASSPY_PROFILES=/profiles
volumes:
- ./rhasspy/profiles:/profiles
- ./config/rhasspy/profiles:/profiles
devices:
- /dev/snd:/dev/snd
ports:
- "12101:12101"
command: --profile en --user-profiles /profiles
hass:
image: homeassistant/home-assistant
network_mode: "host"
@@ -1,181 +0,0 @@
{
"command": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/listen.sh"
},
"oneshot": {
"timeout_sec": 30
},
"system": "webrtcvad",
"webrtcvad": {
"chunk_size": 960,
"min_sec": 2,
"sample_rate": 16000,
"silence_sec": 0.5,
"speech_buffers": 5,
"throwaway_buffers": 10,
"timeout_sec": 30,
"vad_mode": 0
}
},
"handle": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/handle.sh"
},
"forward_to_hass": true,
"system": "hass"
},
"home_assistant": {
"access_token": "",
"api_password": "",
"event_type_format": "rhasspy_{0}",
"url": "http://hassio/homeassistant/"
},
"intent": {
"adapt": {
"stop_words": "stop_words.txt"
},
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/text2intent.sh"
},
"fuzzywuzzy": {
"examples_json": "intent_examples.json"
},
"rasa": {
"examples_markdown": "intent_examples.md",
"project_name": "rhasspy",
"url": "http://localhost:5000/"
},
"remote": {
"url": "http://my-server:12101/api/text-to-intent"
},
"system": "fuzzywuzzy"
},
"language": "en",
"microphone": {
"pyaudio": {
"frames_per_buffer": 480
},
"system": "pyaudio"
},
"mqtt": {
"enabled": false,
"host": "localhost",
"password": "",
"port": 1883,
"publish_intents": true,
"reconnect_sec": 5,
"site_id": "default",
"username": ""
},
"rhasspy": {
"default_profile": "en",
"listen_on_start": true,
"load_timeout_sec": 15,
"preload_profile": true
},
"sounds": {
"recorded": "etc/wav/beep_lo.wav",
"system": "aplay",
"wake": "etc/wav/beep_hi.wav"
},
"speech_to_text": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/speech2text.sh"
},
"g2p_model": "g2p.fst",
"grammars_dir": "grammars",
"pocketsphinx": {
"acoustic_model": "acoustic_model",
"base_dictionary": "base_dictionary.txt",
"custom_words": "custom_words.txt",
"dictionary": "dictionary.txt",
"language_model": "language_model.txt",
"mllr_matrix": "acoustic_model_mllr",
"unknown_words": "unknown_words.txt"
},
"remote": {
"url": "http://my-server:12101/api/speech-to-text"
},
"sentences_ini": "sentences.ini",
"sentences_text": "sentences.txt",
"slots_dir": "slots",
"system": "pocketsphinx"
},
"text_to_speech": {
"espeak": {
"phoneme_map": "espeak_phonemes.txt"
},
"phoneme_examples": "phoneme_examples.txt",
"system": "espeak"
},
"training": {
"balance_sentences": true,
"intent": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/train-intent.sh"
},
"system": "auto"
},
"regex": {
"replace": [
{
"'s": "s"
},
{
"[^\\w ]+": " "
}
],
"split": "\\s+"
},
"sentence_casing": "lower",
"speech_to_text": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/train-stt.sh"
},
"system": "auto"
},
"tagged_sentences": "tagged_sentences.md",
"tokenizer": "regex"
},
"tuning": {
"sphinxtrain": {
"mllr_matrix": "acoustic_model_mllr"
},
"system": "sphinxtrain"
},
"wake": {
"command": {
"arguments": [],
"program": "$RHASSPY_BASE_DIR/bin/mock-commands/sleep.sh"
},
"hermes": {
"wakeword_id": "default"
},
"pocketsphinx": {
"chunk_size": 960,
"keyphrase": "okay rhasspy",
"mllr_matrix": "wake_mllr",
"threshold": 1e-30
},
"precise": {
"chunk_size": 2048,
"model": "okay-rhasspy.pb",
"sensitivity": 0.5,
"trigger_level": 3
},
"snowboy": {
"audio_gain": 1,
"chunk_size": 960,
"model": "snowboy.umdl",
"sensitivity": 0.5
},
"system": "pocketsphinx"
}
}
+1 -9
View File
@@ -6,14 +6,6 @@ export LANG=C.UTF-8
# Directory of *this* script
DIR="$( cd "$( dirname "$0" )" && pwd )"
export RHASSPY_PROFILES="$RHASSPY_PROFILES:$DIR/rhasspy/profiles"
if [[ -z "$RHASSPY_PORT" ]]; then
export RHASSPY_PORT=12101
fi
cd "$DIR/../../"
source .venv/bin/activate
export FLASK_APP=app.py
export RHASSPY_ARGS="$@"
flask run --host=0.0.0.0 --port=$RHASSPY_PORT
python3 app.py "$@"
+1 -1
View File
@@ -44,7 +44,7 @@ def main() -> None:
global mic_stdin_running, mic_stdin_thread
# Parse command-line arguments
parser = argparse.ArgumentParser(description="Rhasspy Voice Assistant")
parser = argparse.ArgumentParser(description="Rhasspy")
parser.add_argument(
"--profile", "-p", required=True, type=str, help="Name of profile to use"
)
+2 -2
View File
@@ -924,10 +924,10 @@ class DialogueManager(RhasspyActor):
# Use command-line speech trainer
return CommandSpeechTrainer
elif trainer_system == "pocketsphinx":
# Use mitlm/phonetisaurus
# Use opengrm/phonetisaurus
return PocketsphinxSpeechTrainer
elif trainer_system == "kaldi":
# Use mitlm/phonetisaurus/kaldi
# Use opengrm/phonetisaurus/kaldi
return KaldiSpeechTrainer
elif trainer_system == "command":
# Use command-line speech trainer
+2 -2
View File
@@ -64,12 +64,12 @@ class DummySpeechTrainer(RhasspyActor):
# -----------------------------------------------------------------------------
# Speech system trainer for Pocketsphinx.
# Uses mitlm (ARPA model) and phonetisaurus (pronunciations).
# Uses opengrm (ARPA model) and phonetisaurus (pronunciations).
# -----------------------------------------------------------------------------
class PocketsphinxSpeechTrainer(RhasspyActor):
"""Trains an ARPA language model using mitlm."""
"""Trains an ARPA language model using opengrm."""
def __init__(self, system: str = "pocketsphinx") -> None:
RhasspyActor.__init__(self)
+4 -3
View File
@@ -14,7 +14,8 @@ fi
docker run -it -p 12101:12101 \
--device /dev/snd:/dev/snd \
-e RHASSPY_PROFILES="/usr/share/rhasspy/profiles:$profile_dir$RHASSPY_PROFILES" \
-v "$profile_dir":"$profile_dir" \
-v "${profile_dir}":"${profile_dir}" \
-v /etc/localtime:/etc/localtime \
synesthesiam/rhasspy-server:latest
synesthesiam/rhasspy-server:latest \
--user-profiles "${profile_dir}" \
"$@"
+6 -5
View File
@@ -15,9 +15,10 @@ fi
user_id=$(id -u)
docker run -d -p 12101:12101 \
--device /dev/snd:/dev/snd \
-e RHASSPY_PROFILES="/home/rhasspy/profiles:$profile_dir$RHASSPY_PROFILES" \
-v "$profile_dir":"$profile_dir" \
-v /run/user/${user_id}/pulse:/run/user/1000/pulse \
-v ${HOME}/.config/pulse/cookie:/home/pacat/.config/pulse/cookie \
-v "${profile_dir}":"${profile_dir}" \
-v "/run/user/${user_id}/pulse":/run/user/1000/pulse \
-v "${HOME}/.config/pulse/cookie:"/home/pacat/.config/pulse/cookie \
-v /etc/localtime:/etc/localtime \
synesthesiam/rhasspy-server:latest
synesthesiam/rhasspy-server:latest \
--user-profiles "${profile_dir}" \
"$@"
+7 -5
View File
@@ -4,13 +4,15 @@ export LC_ALL=C.UTF-8
export LANG=C.UTF-8
# Directory of *this* script
DIR="$( cd "$( dirname "$0" )" && pwd )"
this_dir="$( cd "$( dirname "$0" )" && pwd )"
venv="${this_dir}/.venv"
if [[ -z "$RHASSPY_PORT" ]]; then
export RHASSPY_PORT=12101
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo "Did you run create-venv.sh?"
exit 1
fi
cd "$DIR"
cd "${this_dir}"
source .venv/bin/activate
export RHASSPY_PROFILES="$DIR/profiles:$HOME/.rhasspy-test/profiles"
python3 test.py "$@"
+9 -2
View File
@@ -5,8 +5,15 @@ export LC_ALL=C.UTF-8
export LANG=C.UTF-8
# Directory of *this* script
DIR="$( cd "$( dirname "$0" )" && pwd )"
this_dir="$( cd "$( dirname "$0" )" && pwd )"
venv="${this_dir}/.venv"
cd "$DIR"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo "Did you run create-venv.sh?"
exit 1
fi
cd "${this_dir}"
source .venv/bin/activate
python3 app.py "$@"