-
-
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
fix/lang_plugs_fallback #18
fix/lang_plugs_fallback #18
Conversation
fix default module value for Factories, libretranslate sting was wrong add fallback, if plugin creation fails try the default plugin (libretranslate)
fix default module value for Factories, libretranslate sting was wrong add fallback, if plugin creation fails try the default plugin (libretranslate)
fix default module value for Factories, libretranslate sting was wrong add fallback, if plugin creation fails try the default plugin (libretranslate)
fix default module value for Factories, libretranslate sting was wrong add fallback, if plugin creation fails try the default plugin (libretranslate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think defaults should be read from config or stored in some private variables in case they change in the future
@@ -52,6 +52,11 @@ def create(config=None): | |||
lang_module = OVOSLangDetectionFactory.MAPPINGS[lang_module] | |||
|
|||
clazz = load_lang_detect_plugin(lang_module) | |||
if clazz is None and lang_module != "libretranslate_detection_plug": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this fallback be configurable or at least spec'd in some internal variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, it should read from mycroft.conf (via ovos_utils to account for ovos.conf)
we should also install the default plugin in requirements, probably worth a discussion about what this should be
ideally we want detect and translate to match (so we only add 1 dependency) and to be offline, however there are no good offline translation options
libretranslate is self hosted and makes sense to use, but it introduces latency, maybe detecting could use something like fast lang by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like libretranslate as a default since it's free and reliable. I don't think detection should be necessary very often since we should generally have language specified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
often detection is done before translation to see if it is necessary, arguably whatever is doing that could be refactored to check for lang
param,
regardless at OPM level we should assume lang is never present, that is a concern of core/skills
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True; I think using lang
when it's available will help performance regardless (both speed and accuracy) but we will need to detect in some casts.. I like reducing default dependencies as much as possible, but I'm fine with adding fastlang
if there's a performance benefit
fix default module value for Factories, libretranslate sting was wrong add fallback, if plugin creation fails try the default plugin (libretranslate)
fix default module value for Factories, libretranslate sting was wrong
add fallback, if plugin creation fails try the default plugin (libretranslate)