[micro_wake_word] Ensure model string is Path (#6826)

This commit is contained in:
Michael Hansen 2024-05-29 20:58:13 -05:00 committed by GitHub
parent a7fc1a6298
commit c130ddbe9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -329,11 +329,14 @@ async def to_code(config):
file: Path = base_dir / h.hexdigest()[:8] / model_config[CONF_FILE]
elif model_config[CONF_TYPE] == TYPE_LOCAL:
file = model_config[CONF_PATH]
file = Path(model_config[CONF_PATH])
elif model_config[CONF_TYPE] == TYPE_HTTP:
file = _compute_local_file_path(model_config) / "manifest.json"
else:
raise ValueError("Unsupported config type: {model_config[CONF_TYPE]}")
manifest, data = _load_model_data(file)
rhs = [HexInt(x) for x in data]