bad storage ref deduction bugfix
@@ -140,14 +140,16 @@ def resolve_storage_ref(lang, storage_ref,missing_component_type):
elif lang in nlu.NameSpace.storage_ref_2_nlu_ref.keys():
if storage_ref in nlu.NameSpace.storage_ref_2_nlu_ref[lang].keys():
nlu_ref = nlu.NameSpace.storage_ref_2_nlu_ref[lang][storage_ref] # a HC model may use OS storage_ref_provider, so we dont know yet if it is licensed or not
+ if nlu_ref is not None and 'xx.' in nlu_ref : lang = 'xx'
- if nlu_ref in nlu.NameSpace.pretrained_models_references[lang].keys():
+ if lang in nlu.NameSpace.pretrained_models_references.keys() and nlu_ref in nlu.NameSpace.pretrained_models_references[lang].keys():
nlp_ref = nlu.NameSpace.pretrained_models_references[lang][nlu_ref]
- elif nlu_ref in nlu.NameSpace.pretrained_healthcare_model_references[lang].keys():
+ elif lang in nlu.NameSpace.pretrained_healthcare_model_references.keys() and nlu_ref in nlu.NameSpace.pretrained_healthcare_model_references[lang].keys():
nlp_ref = nlu.NameSpace.pretrained_healthcare_model_references[lang][nlu_ref]
is_licensed = True
- # check if storage_ref matches nlu_ref
+
+ # check if storage_ref matches nlu_ref and get NLP_ref
elif lang in nlu.NameSpace.licensed_storage_ref_2_nlu_ref.keys():
if storage_ref in nlu.NameSpace.licensed_storage_ref_2_nlu_ref[lang].keys():
nlu_ref = storage_ref
