mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-30 11:52:04 +00:00
fix(moa): tolerate non-list reference_models in hand-edited MoA preset config
This commit is contained in:
parent
60f58a2b95
commit
8dd4e576d0
1 changed files with 7 additions and 1 deletions
|
|
@ -74,7 +74,13 @@ def _normalize_preset(raw: Any) -> dict[str, Any]:
|
|||
if not isinstance(raw, dict):
|
||||
raw = {}
|
||||
|
||||
refs = [_clean_slot(item) for item in raw.get("reference_models") or []]
|
||||
raw_refs = raw.get("reference_models")
|
||||
if not isinstance(raw_refs, list):
|
||||
# A hand-edited scalar / single mapping (or a bad type) must degrade to
|
||||
# defaults instead of crashing the iteration, mirroring the tolerance
|
||||
# for the scalar fields below (reference_temperature / max_tokens).
|
||||
raw_refs = [raw_refs] if isinstance(raw_refs, dict) else []
|
||||
refs = [_clean_slot(item) for item in raw_refs]
|
||||
refs = [item for item in refs if item is not None]
|
||||
if not refs:
|
||||
refs = deepcopy(DEFAULT_MOA_REFERENCE_MODELS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue