mirror of https://github.com/CIRCL/AIL-framework
fix: [language detector] fix exception if the libretranslate url is not specified
parent
adbce24128
commit
0c28b38638
|
@ -440,6 +440,10 @@ def delete_obj_translation(obj_global_id, language, field=''):
|
|||
class LanguagesDetector:
|
||||
|
||||
def __init__(self, nb_langs=3, min_proportion=0.2, min_probability=-1, min_len=0):
|
||||
lt_url = get_translator_instance()
|
||||
if not lt_url:
|
||||
self.lt = None
|
||||
else:
|
||||
self.lt = LibreTranslateAPI(get_translator_instance())
|
||||
try:
|
||||
self.lt.languages()
|
||||
|
|
Loading…
Reference in New Issue