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

fix/lang_plugs_fallback #18

Merged
merged 2 commits into from
Mar 12, 2022
Merged

fix/lang_plugs_fallback #18

merged 2 commits into from
Mar 12, 2022

Conversation

NeonJarbas
Copy link
Contributor

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)
@JarbasAl JarbasAl requested a review from NeonDaniel November 22, 2021 20:41
@JarbasAl JarbasAl added the enhancement New feature or request label Nov 22, 2021
JarbasAl added a commit that referenced this pull request Dec 1, 2021
fix default module value for Factories, libretranslate sting was wrong

add fallback, if plugin creation fails try the default plugin (libretranslate)
JarbasAl added a commit that referenced this pull request Dec 1, 2021
fix default module value for Factories, libretranslate sting was wrong

add fallback, if plugin creation fails try the default plugin (libretranslate)
JarbasAl added a commit that referenced this pull request Dec 2, 2021
fix default module value for Factories, libretranslate sting was wrong

add fallback, if plugin creation fails try the default plugin (libretranslate)
Copy link
Member

@NeonDaniel NeonDaniel left a 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":
Copy link
Member

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?

Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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 langparam,

regardless at OPM level we should assume lang is never present, that is a concern of core/skills

Copy link
Member

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

JarbasAl added a commit that referenced this pull request Feb 3, 2022
fix default module value for Factories, libretranslate sting was wrong

add fallback, if plugin creation fails try the default plugin (libretranslate)
@JarbasAl JarbasAl added the bug Something isn't working label Feb 14, 2022
@JarbasAl JarbasAl deleted the branch OpenVoiceOS:master February 24, 2022 20:43
@JarbasAl JarbasAl closed this Feb 24, 2022
@JarbasAl JarbasAl reopened this Mar 12, 2022
@JarbasAl JarbasAl merged commit f170ab7 into OpenVoiceOS:master Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants