Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/layerlens/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.3.3"
__version__ = "1.4.0"

# Will be templated during the build
__git_commit__ = "__GIT_COMMIT__"
4 changes: 4 additions & 0 deletions src/layerlens/resources/comparisons/comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def compare_models(
sort_by="submitted_at",
order="desc",
page_size=1,
unique=True,
timeout=timeout,
)
eval_id_1 = _find_evaluation_id(resp1, model_id_1, benchmark_id)
Expand All @@ -93,6 +94,7 @@ def compare_models(
sort_by="submitted_at",
order="desc",
page_size=1,
unique=True,
timeout=timeout,
)
eval_id_2 = _find_evaluation_id(resp2, model_id_2, benchmark_id)
Expand Down Expand Up @@ -172,6 +174,7 @@ async def compare_models(
sort_by="submitted_at",
order="desc",
page_size=1,
unique=True,
timeout=timeout,
)
eval_id_1 = _find_evaluation_id(resp1, model_id_1, benchmark_id)
Expand All @@ -183,6 +186,7 @@ async def compare_models(
sort_by="submitted_at",
order="desc",
page_size=1,
unique=True,
timeout=timeout,
)
eval_id_2 = _find_evaluation_id(resp2, model_id_2, benchmark_id)
Expand Down
8 changes: 8 additions & 0 deletions src/layerlens/resources/evaluations/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_many(
model_ids: Optional[List[str]] = None,
benchmark_ids: Optional[List[str]] = None,
status: Optional[EvaluationStatus] = None,
unique: bool = False,
timeout: float | httpx.Timeout | None = DEFAULT_TIMEOUT,
) -> Optional[EvaluationsResponse]:
"""
Expand All @@ -99,6 +100,7 @@ def get_many(
model_ids: Filter by model IDs
benchmark_ids: Filter by benchmark/dataset IDs
status: Filter by evaluation status
unique: If True, deduplicate by model+dataset keeping only the latest evaluation per pair
timeout: Request timeout

Returns:
Expand All @@ -125,6 +127,8 @@ def get_many(
params["datasets"] = ",".join(benchmark_ids)
if status:
params["status"] = status.value
if unique:
params["unique"] = "true"

resp = self._get(
f"/evaluations",
Expand Down Expand Up @@ -241,6 +245,7 @@ async def get_many(
model_ids: Optional[List[str]] = None,
benchmark_ids: Optional[List[str]] = None,
status: Optional[EvaluationStatus] = None,
unique: bool = False,
timeout: float | httpx.Timeout | None = DEFAULT_TIMEOUT,
) -> Optional[EvaluationsResponse]:
"""
Expand All @@ -254,6 +259,7 @@ async def get_many(
model_ids: Filter by model IDs
benchmark_ids: Filter by benchmark/dataset IDs
status: Filter by evaluation status
unique: If True, deduplicate by model+dataset keeping only the latest evaluation per pair
timeout: Request timeout

Returns:
Expand All @@ -280,6 +286,8 @@ async def get_many(
params["datasets"] = ",".join(benchmark_ids)
if status:
params["status"] = status.value
if unique:
params["unique"] = "true"

resp = await self._get(
f"/evaluations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def get_many(
model_ids: Optional[List[str]] = None,
benchmark_ids: Optional[List[str]] = None,
status: Optional[EvaluationStatus] = None,
unique: bool = False,
timeout: float | httpx.Timeout | None = DEFAULT_TIMEOUT,
) -> Optional[EvaluationsResponse]:
"""
Expand All @@ -57,6 +58,7 @@ def get_many(
model_ids: Filter by model IDs
benchmark_ids: Filter by benchmark/dataset IDs
status: Filter by evaluation status
unique: If True, deduplicate by model+dataset keeping only the latest evaluation per pair
timeout: Request timeout

Returns:
Expand All @@ -80,6 +82,8 @@ def get_many(
params["datasets"] = ",".join(benchmark_ids)
if status:
params["status"] = status.value
if unique:
params["unique"] = "true"

resp = self._get(
"/evaluations",
Expand Down Expand Up @@ -137,6 +141,7 @@ async def get_many(
model_ids: Optional[List[str]] = None,
benchmark_ids: Optional[List[str]] = None,
status: Optional[EvaluationStatus] = None,
unique: bool = False,
timeout: float | httpx.Timeout | None = DEFAULT_TIMEOUT,
) -> Optional[EvaluationsResponse]:
"""
Expand All @@ -150,6 +155,7 @@ async def get_many(
model_ids: Filter by model IDs
benchmark_ids: Filter by benchmark/dataset IDs
status: Filter by evaluation status
unique: If True, deduplicate by model+dataset keeping only the latest evaluation per pair
timeout: Request timeout

Returns:
Expand All @@ -173,6 +179,8 @@ async def get_many(
params["datasets"] = ",".join(benchmark_ids)
if status:
params["status"] = status.value
if unique:
params["unique"] = "true"

resp = await self._get(
"/evaluations",
Expand Down
2 changes: 2 additions & 0 deletions tests/resources/test_comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def test_compare_models_success(self, comparisons, mock_public_client):
assert calls[0].kwargs["sort_by"] == "submitted_at"
assert calls[0].kwargs["order"] == "desc"
assert calls[0].kwargs["page_size"] == 1
assert calls[0].kwargs["unique"] is True

assert calls[1].kwargs["model_ids"] == ["model-b"]

Expand Down Expand Up @@ -199,3 +200,4 @@ def test_compare_models_picks_most_recent(self, comparisons, mock_public_client)
assert call.kwargs["order"] == "desc"
assert call.kwargs["page_size"] == 1
assert call.kwargs["status"] == EvaluationStatus.SUCCESS
assert call.kwargs["unique"] is True
Loading