Bootstrap architecture rules from task history
This commit is contained in:
@@ -155,6 +155,9 @@ class ModelHubClient:
|
||||
end_time: datetime | None = None,
|
||||
gpu_type: str | None = None,
|
||||
model_id: str | None = None,
|
||||
status: str | None = None,
|
||||
verify_result: int | None = None,
|
||||
max_records: int = 0,
|
||||
) -> list[dict[str, Any]]:
|
||||
current = 1
|
||||
records: list[dict[str, Any]] = []
|
||||
@@ -167,10 +170,14 @@ class ModelHubClient:
|
||||
end_time=end_time,
|
||||
gpu_type=gpu_type,
|
||||
model_id=model_id,
|
||||
status=status,
|
||||
verify_result=verify_result,
|
||||
)
|
||||
page_data = page.get("data") or {}
|
||||
page_records = page_data.get("records") or []
|
||||
records.extend(page_records)
|
||||
if max_records > 0 and len(records) >= max_records:
|
||||
return records[:max_records]
|
||||
pages = int(page_data.get("pages") or 0)
|
||||
if pages <= current or not page_records:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user