diff --git a/create-venv.sh b/create-venv.sh index f6dda81..13c5feb 100755 --- a/create-venv.sh +++ b/create-venv.sh @@ -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" diff --git a/docker/run.sh b/docker/run.sh index 873ec40..c85a14a 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -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 diff --git a/docker/templates/Dockerfile.template b/docker/templates/Dockerfile.template index a91ee42..7ada957 100755 --- a/docker/templates/Dockerfile.template +++ b/docker/templates/Dockerfile.template @@ -16,14 +16,12 @@ SYSTEM_DEPENDENCIES PHONETISAURUS -MITLM +OPENGRM PYTHON_REQUIREMENTS PYTHON_POCKETSPHINX -PYJSGF - SNOWBOY MYCROFT_PRECISE diff --git a/docker/templates/dockerfiles/Dockerfile.from-source.alsa.all b/docker/templates/dockerfiles/Dockerfile.from-source.alsa.all index 87f8d0f..56c4d76 100644 --- a/docker/templates/dockerfiles/Dockerfile.from-source.alsa.all +++ b/docker/templates/dockerfiles/Dockerfile.from-source.alsa.all @@ -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 diff --git a/docker/templates/dockerfiles/Dockerfile.from-source.alsa.en b/docker/templates/dockerfiles/Dockerfile.from-source.alsa.en index 2f8b422..17716a6 100644 --- a/docker/templates/dockerfiles/Dockerfile.from-source.alsa.en +++ b/docker/templates/dockerfiles/Dockerfile.from-source.alsa.en @@ -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 diff --git a/docker/templates/dockerfiles/Dockerfile.from-source.pulseaudio.en b/docker/templates/dockerfiles/Dockerfile.from-source.pulseaudio.en index ae3daab..8bdf5a2 100644 --- a/docker/templates/dockerfiles/Dockerfile.from-source.pulseaudio.en +++ b/docker/templates/dockerfiles/Dockerfile.from-source.pulseaudio.en @@ -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 diff --git a/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.all b/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.all index d75bec8..2620299 100755 --- a/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.all +++ b/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.all @@ -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 diff --git a/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.en b/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.en index 596951c..71823e2 100755 --- a/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.en +++ b/docker/templates/dockerfiles/Dockerfile.prebuilt.alsa.en @@ -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 diff --git a/docker/templates/dockerfiles/Dockerfile.prebuilt.pulseaudio.en b/docker/templates/dockerfiles/Dockerfile.prebuilt.pulseaudio.en index 06ca13d..fbd9249 100755 --- a/docker/templates/dockerfiles/Dockerfile.prebuilt.pulseaudio.en +++ b/docker/templates/dockerfiles/Dockerfile.prebuilt.pulseaudio.en @@ -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 diff --git a/docker/templates/shared/opengrm.txt b/docker/templates/shared/opengrm.txt new file mode 100644 index 0000000..99a229c --- /dev/null +++ b/docker/templates/shared/opengrm.txt @@ -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* diff --git a/docker/templates/shared/python_requirements.txt b/docker/templates/shared/python_requirements.txt index 5fa2d99..641a19a 100755 --- a/docker/templates/shared/python_requirements.txt +++ b/docker/templates/shared/python_requirements.txt @@ -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 diff --git a/download-dependencies.sh b/download-dependencies.sh index bfe0f9a..042e71b 100755 --- a/download-dependencies.sh +++ b/download-dependencies.sh @@ -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 # ----------------------------------------------------------------------------- diff --git a/examples/client-server/client/profiles/defaults.json b/examples/client-server/client/profiles/defaults.json deleted file mode 100755 index 8360abc..0000000 --- a/examples/client-server/client/profiles/defaults.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/examples/client-server/docker-compose.yml b/examples/client-server/docker-compose.yml index a56a863..5adc1b4 100755 --- a/examples/client-server/docker-compose.yml +++ b/examples/client-server/docker-compose.yml @@ -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: diff --git a/examples/client-server/server/profiles/defaults.json b/examples/client-server/server/profiles/defaults.json deleted file mode 100755 index 8360abc..0000000 --- a/examples/client-server/server/profiles/defaults.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/examples/copy-audio/docker-compose.yml b/examples/copy-audio/docker-compose.yml index 1cefe12..029e710 100755 --- a/examples/copy-audio/docker-compose.yml +++ b/examples/copy-audio/docker-compose.yml @@ -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 diff --git a/examples/copy-audio/rhasspy/profiles/defaults.json b/examples/copy-audio/rhasspy/profiles/defaults.json deleted file mode 100755 index 804ac78..0000000 --- a/examples/copy-audio/rhasspy/profiles/defaults.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/examples/copy-audio/run-venv.sh b/examples/copy-audio/run-venv.sh index 53054ff..12ab320 100755 --- a/examples/copy-audio/run-venv.sh +++ b/examples/copy-audio/run-venv.sh @@ -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 "$@" diff --git a/examples/mqtt-hermes/rhasspy/profiles/defaults.json b/examples/mqtt-hermes/rhasspy/profiles/defaults.json deleted file mode 100755 index b4ba869..0000000 --- a/examples/mqtt-hermes/rhasspy/profiles/defaults.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/examples/mqtt-hermes/run-venv.sh b/examples/mqtt-hermes/run-venv.sh index 53054ff..acb56eb 100755 --- a/examples/mqtt-hermes/run-venv.sh +++ b/examples/mqtt-hermes/run-venv.sh @@ -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 "$@" diff --git a/examples/typical-intent/docker-compose.yml b/examples/typical-intent/docker-compose.yml index 1e86b8b..041dd5d 100755 --- a/examples/typical-intent/docker-compose.yml +++ b/examples/typical-intent/docker-compose.yml @@ -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: diff --git a/examples/typical-intent/rhasspy/profiles/defaults.json b/examples/typical-intent/rhasspy/profiles/defaults.json deleted file mode 100755 index 8360abc..0000000 --- a/examples/typical-intent/rhasspy/profiles/defaults.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/examples/typical/docker-compose.yml b/examples/typical/docker-compose.yml index 26384bd..e61f519 100755 --- a/examples/typical/docker-compose.yml +++ b/examples/typical/docker-compose.yml @@ -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" diff --git a/examples/typical/rhasspy/profiles/defaults.json b/examples/typical/rhasspy/profiles/defaults.json deleted file mode 100755 index 804ac78..0000000 --- a/examples/typical/rhasspy/profiles/defaults.json +++ /dev/null @@ -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" - } -} \ No newline at end of file diff --git a/examples/typical/run-venv.sh b/examples/typical/run-venv.sh index 53054ff..12ab320 100755 --- a/examples/typical/run-venv.sh +++ b/examples/typical/run-venv.sh @@ -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 "$@" diff --git a/rhasspy/__init__.py b/rhasspy/__init__.py index f1f2a38..4496fac 100755 --- a/rhasspy/__init__.py +++ b/rhasspy/__init__.py @@ -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" ) diff --git a/rhasspy/dialogue.py b/rhasspy/dialogue.py index d14d6aa..e6b97e8 100755 --- a/rhasspy/dialogue.py +++ b/rhasspy/dialogue.py @@ -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 diff --git a/rhasspy/stt_train.py b/rhasspy/stt_train.py index 73ebf2d..6e1144a 100755 --- a/rhasspy/stt_train.py +++ b/rhasspy/stt_train.py @@ -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) diff --git a/run-docker-alsa.sh b/run-docker-alsa.sh index 0ce57a8..546eddb 100755 --- a/run-docker-alsa.sh +++ b/run-docker-alsa.sh @@ -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}" \ + "$@" diff --git a/run-docker-pulseaudio.sh b/run-docker-pulseaudio.sh index 3027d17..0846bc9 100755 --- a/run-docker-pulseaudio.sh +++ b/run-docker-pulseaudio.sh @@ -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}" \ + "$@" diff --git a/run-tests.sh b/run-tests.sh index 1b842f5..722dd86 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -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 "$@" diff --git a/run-venv.sh b/run-venv.sh index 35abc12..cf99921 100755 --- a/run-venv.sh +++ b/run-venv.sh @@ -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 "$@"