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

Feat/init refactor #23

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dblencowe
Copy link
Contributor

@dblencowe dblencowe commented Jan 22, 2024

Tested on my Mk2 with the alba-medium voice
Can be tested with

pip uninstall ovos-tts-plugin-piper && \
  pip install git+https://github.com/dblencowe/ovos-tts-plugin-piper@feat/init-refactor
sudo systemctl restart neon-audio

@goldyfruit
Copy link
Member

Why all the changes in CHANGELOG.md?

@dblencowe
Copy link
Contributor Author

Why all the changes in CHANGELOG.md?

Awful Git skills after having a mare with the Pipelines. Sorry!

@goldyfruit
Copy link
Member

Why all the changes in CHANGELOG.md?

Awful Git skills after having a mare with the Pipelines. Sorry!

No worries 👍

Copy link
Member

@builderjer builderjer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works when downloading from a tz file but fails to load when pointed to an onyx file.

2024-01-25 06:52:24.805 - audio - ovos_tts_plugin_piper:download_model:335 - INFO - downloading piper model: https://huggingface.co/rhasspy/piper-voices/blob/v1.0.0/en/en_GB/vctk/medium/en_GB-vctk-medium.onnx
2024-01-25 06:52:25.661 - audio - ovos_plugin_manager.tts:create:215 - ERROR - The TTS plugin "ovos-tts-plugin-piper" could not be loaded.
Available modules: ovos-tts-plugin-piper,ovos-tts-plugin-dummy,ovos-tts-plugin-server,ovos-tts-plugin-mimic3-server,ovos-tts-plugin-mimic
Traceback (most recent call last):
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_plugin_manager/tts.py", line 206, in create
    tts = clazz(lang=None,  # explicitly read lang from config
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 267, in __init__
    self.get_model(voice=self.voice)
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 317, in get_model
    engine = self.load_model_directory(xdg_p)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 355, in load_model_directory
    config_dict = json.load(config_file)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-01-25 06:52:25.665 - audio - ovos_audio.service:__init__:93 - ERROR - Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/ovos/ovos-src/ovos-audio/ovos_audio/service.py", line 90, in __init__
    self._maybe_reload_tts()
  File "/home/ovos/ovos-src/ovos-audio/ovos_audio/service.py", line 318, in _maybe_reload_tts
    self.tts = TTSFactory.create(config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/ovos-src/ovos-audio/ovos_audio/tts.py", line 9, in create
    return OVOSTTSFactory.create(config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_plugin_manager/tts.py", line 206, in create
    tts = clazz(lang=None,  # explicitly read lang from config
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 267, in __init__
    self.get_model(voice=self.voice)
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 317, in get_model
    engine = self.load_model_directory(xdg_p)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 355, in load_model_directory
    config_dict = json.load(config_file)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-01-25 06:52:25.675 - audio - ovos_audio.service:on_error:44 - ERROR - Audio service failed to launch (Expecting value: line 1 column 1 (char 0)).

Tested with multiple voices

@dblencowe dblencowe force-pushed the feat/init-refactor branch 2 times, most recently from b7ef5cd to 64723ac Compare January 29, 2024 18:50
Copy link
Contributor

@mikejgray mikejgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to test tonight

requirements.txt Outdated
@@ -1,2 +1,3 @@
ovos-plugin-manager>=0.0.5
piper-tts==1.2.0
piper-tts==1.1.0
onnxruntime==1.16.3
Copy link
Member

@goldyfruit goldyfruit Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that should be the case, but installs within the Neon docker container were failing as that dependency wasn't installed

requirements.txt Outdated Show resolved Hide resolved
@dblencowe
Copy link
Contributor Author

This works when downloading from a tz file but fails to load when pointed to an onyx file.

2024-01-25 06:52:24.805 - audio - ovos_tts_plugin_piper:download_model:335 - INFO - downloading piper model: https://huggingface.co/rhasspy/piper-voices/blob/v1.0.0/en/en_GB/vctk/medium/en_GB-vctk-medium.onnx
2024-01-25 06:52:25.661 - audio - ovos_plugin_manager.tts:create:215 - ERROR - The TTS plugin "ovos-tts-plugin-piper" could not be loaded.
Available modules: ovos-tts-plugin-piper,ovos-tts-plugin-dummy,ovos-tts-plugin-server,ovos-tts-plugin-mimic3-server,ovos-tts-plugin-mimic
Traceback (most recent call last):
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_plugin_manager/tts.py", line 206, in create
    tts = clazz(lang=None,  # explicitly read lang from config
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 267, in __init__
    self.get_model(voice=self.voice)
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 317, in get_model
    engine = self.load_model_directory(xdg_p)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 355, in load_model_directory
    config_dict = json.load(config_file)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-01-25 06:52:25.665 - audio - ovos_audio.service:__init__:93 - ERROR - Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/ovos/ovos-src/ovos-audio/ovos_audio/service.py", line 90, in __init__
    self._maybe_reload_tts()
  File "/home/ovos/ovos-src/ovos-audio/ovos_audio/service.py", line 318, in _maybe_reload_tts
    self.tts = TTSFactory.create(config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/ovos-src/ovos-audio/ovos_audio/tts.py", line 9, in create
    return OVOSTTSFactory.create(config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_plugin_manager/tts.py", line 206, in create
    tts = clazz(lang=None,  # explicitly read lang from config
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 267, in __init__
    self.get_model(voice=self.voice)
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 317, in get_model
    engine = self.load_model_directory(xdg_p)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ovos/venv-ovos/lib/python3.11/site-packages/ovos_tts_plugin_piper/__init__.py", line 355, in load_model_directory
    config_dict = json.load(config_file)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2024-01-25 06:52:25.675 - audio - ovos_audio.service:on_error:44 - ERROR - Audio service failed to launch (Expecting value: line 1 column 1 (char 0)).

Tested with multiple voices

I'll look at this; I'm using alba-medium (lookup URL from the list) which has downloaded and deployed fine.

Copy link

codecov bot commented Jan 30, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@dblencowe dblencowe force-pushed the feat/init-refactor branch 2 times, most recently from 699757b to 3819cd8 Compare January 30, 2024 18:58
@JarbasAl JarbasAl added the enhancement New feature or request label Feb 12, 2024
Copy link
Contributor

@mikejgray mikejgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked fine with alan-low on a machine where I already had the model downloaded, but failed with the same error that @builderjer had when trying to use ryan-high

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants