feat: add tiered durable state and memory bounds
This commit is contained in:
@@ -18,7 +18,13 @@ class SafeConfigOptimizer:
|
||||
self._qualified = self._learn()
|
||||
|
||||
def _learn(self) -> dict[tuple[str, str, str], list[dict[str, Any]]]:
|
||||
outcomes = read_jsonl(self.outcomes_path)
|
||||
recent_path = Path(".modelhub_state/recent_outcomes.jsonl")
|
||||
outcomes_by_key: dict[str, dict[str, Any]] = {}
|
||||
for item in [*read_jsonl(recent_path), *read_jsonl(self.outcomes_path)]:
|
||||
task_id = str(item.get("taskId") or "")
|
||||
if task_id:
|
||||
outcomes_by_key[task_id] = item
|
||||
outcomes = list(outcomes_by_key.values())
|
||||
by_task = {
|
||||
str(item.get("taskId")): item
|
||||
for item in outcomes
|
||||
@@ -117,4 +123,3 @@ class SafeConfigOptimizer:
|
||||
"evidenceLowerBound": choice["lowerBound"],
|
||||
"fingerprint": choice["fingerprint"],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user