Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timing metrics for minerva testing #175

Merged
merged 5 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ on:
jobs:
license_tests:
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
with:
packages-exclude: '^(precise-runner|fann2|tqdm|bs4|ovos-phal-plugin|ovos-skill|neon-core|nvidia|neon-phal-plugin|bitstruct|audioread).*'
9 changes: 7 additions & 2 deletions neon_speech/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from neon_utils.file_utils import decode_base64_string_to_file
from ovos_utils.log import LOG
from neon_utils.configuration_utils import get_neon_user_config
from neon_utils.metrics_utils import Stopwatch
from neon_utils.user_utils import apply_local_user_profile_updates
from ovos_bus_client import Message
from ovos_config.config import update_mycroft_config
Expand Down Expand Up @@ -79,6 +80,8 @@ def on_started():


class NeonSpeechClient(OVOSDinkumVoiceService):
_stopwatch = Stopwatch("get_stt")

def __init__(self, ready_hook=on_ready, error_hook=on_error,
stopping_hook=on_stopping, alive_hook=on_alive,
started_hook=on_started, watchdog=lambda: None,
Expand Down Expand Up @@ -372,10 +375,12 @@ def build_context(msg: Message):
wav_file_path = message.data.get("audio_file")
lang = message.data.get("lang")
try:
_, parser_data, transcriptions = \
self._get_stt_from_file(wav_file_path, lang)
with self._stopwatch:
_, parser_data, transcriptions = \
self._get_stt_from_file(wav_file_path, lang)
message.context["audio_parser_data"] = parser_data
context = build_context(message)
context['timing']['get_stt'] = self._stopwatch.time
data = {
"utterances": transcriptions,
"lang": message.data.get("lang", "en-us")
Expand Down
2 changes: 2 additions & 0 deletions requirements/docker.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ovos-stt-plugin-vosk~=0.1
neon-stt-plugin-nemo~=0.0.2
onnxruntime!=1.16.0 # TODO: Patching https://github.com/microsoft/onnxruntime/issues/17631

# Load alternative WW plugins so they are available
ovos-ww-plugin-pocketsphinx~=0.1
ovos-ww-plugin-precise-lite~=0.1
Expand Down
3 changes: 2 additions & 1 deletion requirements/test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ ovos-stt-plugin-server~=0.0.3
pytest
mock~=4.0
pydub~=0.23
SpeechRecognition~=3.8
SpeechRecognition~=3.8
onnxruntime!=1.16.0 # TODO: Patching https://github.com/microsoft/onnxruntime/issues/17631