feat: compact durable logs and refine framework routing
This commit is contained in:
@@ -138,6 +138,20 @@ class SuccessFirstRoutingEngine:
|
||||
|
||||
selected: list[dict[str, Any]] = []
|
||||
for routes in by_model.values():
|
||||
# The platform permits some transformers submissions only after a
|
||||
# non-transformers attempt has failed. Prefer an immediately
|
||||
# executable route whenever one exists; transformers remains a
|
||||
# fallback for tasks/models with no other official route.
|
||||
non_transformers = [
|
||||
item for item in routes if str(item.get("framework") or "").casefold() != "transformers"
|
||||
]
|
||||
transformers_unlocked = any(
|
||||
bool(item.get("transformersPrerequisiteSatisfied"))
|
||||
for item in routes
|
||||
if str(item.get("framework") or "").casefold() == "transformers"
|
||||
)
|
||||
if non_transformers and not transformers_unlocked:
|
||||
routes = non_transformers
|
||||
best = max(float(item["routingSuccessLowerBound"]) for item in routes)
|
||||
close = [item for item in routes if best - float(item["routingSuccessLowerBound"]) <= 0.05]
|
||||
close.sort(
|
||||
|
||||
Reference in New Issue
Block a user