Skip to content

Commit 4876eec

Browse files
committed
CU-8699pqzp5 Legacy conversion (#32)
* CU-8699pqzp5: Fix config conversion when old config does not have a value. * CU-8699pqzp5: Convert en_core_sci_lg to en_core_web_md at model convert time
1 parent 89f3710 commit 4876eec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

medcat-v2/medcat/utils/legacy/convert_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def get_val_and_parent_model(old_data: Optional[dict],
7171
logger.warning(
7272
"Optional path '%s' not found in old config. Ignoring",
7373
path)
74+
val = None
7475
break
7576
val = val[cname]
7677
return val, target_model
@@ -166,7 +167,8 @@ def get_config_from_nested_dict(old_data: dict) -> Config:
166167
# but we now default to regex
167168
cnf.general.nlp.provider = 'spacy'
168169
cnf = _make_changes(cnf, old_data)
169-
if cnf.general.nlp.modelname in ('spacy_model', 'en_core_sci_md'):
170+
if cnf.general.nlp.modelname in ('spacy_model', 'en_core_sci_md',
171+
'en_core_sci_lg'):
170172
logger.info("Fixing spacy model. "
171173
"Moving from '%s' to 'en_core_web_md'!",
172174
cnf.general.nlp.modelname)

0 commit comments

Comments
 (0)