Skip to content

Commit

Permalink
fix merge list with prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Jan 24, 2025
1 parent 7b755c9 commit 16885ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/olmo_core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 16885ab

Please sign in to comment.