-
Notifications
You must be signed in to change notification settings - Fork 11
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
STT class init with wrong config #132
Comments
My suggestion: @staticmethod
def get_class(config=None):
# config = config or get_stt_config()
config = get_stt_config(config)
stt_module = config["module"]
if stt_module in OVOSSTTFactory.MAPPINGS:
stt_module = OVOSSTTFactory.MAPPINGS[stt_module]
return load_stt_plugin(stt_module)
@staticmethod
def create(config=None):
# config = get_stt_config(config)
# plugin = config["module"]
# plugin_config = config.get(plugin) or {}
try:
clazz = OVOSSTTFactory.get_class(config)
return clazz(config)
except Exception:
LOG.exception('The selected STT plugin could not be loaded!')
raise works with whole config or section. But you have the bigger picture. |
Imagine my head exploding when realizing this is not reproducable on another machine. But - in my estimation - the "fix" made along the way covers the initial problem: that the class is initiated with an emtpy dict,
|
I think this may be related to #161 . In general, the The main purpose of the method here is to make sure |
I can confirm similar issues with TTS. mycroft.conf loaded to both /etc/mycroft/mycroft.conf and /root/.config/mycroft/mycroft.conf in a container running tts-server: {
"lang": "de-de",
"tts": {
"module": "ovos_tts_plugin_espeakng",
"ovos_tts_plugin_espeakng": {
"lang": "de-de",
"voice": "german-mbrola-5",
"speed": "135",
"amplitude": "80",
"pitch": "20"
}
}
} Output from logging into the container: root@c6d9a23498f8:/# ovos-config get -k tts
Value: {'pulse_duck': False, 'module': 'ovos_tts_plugin_espeakng', 'fallback_module': '', 'ovos-tts-plugin-mimic': {'voice': 'ap'},
'ovos-tts-plugin-mimic3-server': {'voice': 'en_UK/apope_low'}, 'ovos_tts_plugin_espeakng': {'lang': 'de-de', 'voice': 'german-mbrola-5', 'speed': '135',
'amplitude': '80', 'pitch': '20'}}, found in /tts
Value: {'voice': 'ap'}, found in /tts/ovos-tts-plugin-mimic
Value: {'voice': 'en_UK/apope_low'}, found in /tts/ovos-tts-plugin-mimic3-server
Value: {'lang': 'de-de', 'voice': 'german-mbrola-5', 'speed': '135', 'amplitude': '80', 'pitch': '20'}, found in /tts/ovos_tts_plugin_espeakng Log of 2023-09-01 21:18:39.977 - OVOS - ovos_tts_plugin_espeakng:__init__:30 - DEBUG - {'persist_cache': False, 'lang': 'de-de'} Most recent alpha does not show messages from LOG on stdout, so I can't verify the same. |
config passed:
get_stt_config
will now mangle the config and returns (as config)since it has its own definitions.
but
plugin_config = config.get(plugin) or {}
will produce an empty dict and the class will get initialized with this empty dictovos-plugin-manager/ovos_plugin_manager/stt.py
Lines 130 to 135 in c5a1d7d
Because it (the module) has its own definition it's irrelevant if you pass
The result will be the same.
Reproduce with:
The text was updated successfully, but these errors were encountered: