From 16885abae7d9bca0fa7a07a911135d6e8874243a Mon Sep 17 00:00:00 2001 From: epwalsh Date: Thu, 23 Jan 2025 16:16:18 -0800 Subject: [PATCH] fix merge list with prefix --- src/olmo_core/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/olmo_core/config.py b/src/olmo_core/config.py index d6ef4f12..a211b729 100644 --- a/src/olmo_core/config.py +++ b/src/olmo_core/config.py @@ -170,7 +170,9 @@ def merge(self, dotlist: List[str], prefix: Optional[str] = None, strict: bool = try: dotlist = _clean_opts(dotlist) if prefix is not None: - dotlist = [o.lstrip(f"{prefix}.") for o in dotlist if o.startswith(f"{prefix}.")] + dotlist = [ + o.replace(f"{prefix}.", "", 1) for o in dotlist if o.startswith(f"{prefix}.") + ] if not strict: field_names = set(f.name for f in fields(self)) dotlist = [