Skip to content

Commit 0560dc9

Browse files
author
Val Brodsky
committed
Fix create_model_evaluation_project
1 parent d96773e commit 0560dc9

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ def create_project(
638638
}
639639
return self._create_project(_CoreProjectInput(**input))
640640

641-
@overload
642641
def create_model_evaluation_project(
643642
self,
644643
name: str,
@@ -652,16 +651,6 @@ def create_model_evaluation_project(
652651
dataset_id: Optional[str] = None,
653652
dataset_name: Optional[str] = None,
654653
data_row_count: Optional[int] = None,
655-
**kwargs,
656-
) -> Project:
657-
pass
658-
659-
def create_model_evaluation_project(
660-
self,
661-
dataset_id: Optional[str] = None,
662-
dataset_name: Optional[str] = None,
663-
data_row_count: Optional[int] = None,
664-
**kwargs,
665654
) -> Project:
666655
"""
667656
Use this method exclusively to create a chat model evaluation project.
@@ -694,13 +683,8 @@ def create_model_evaluation_project(
694683
append_to_existing_dataset = bool(dataset_id)
695684

696685
if dataset_name_or_id:
697-
kwargs["dataset_name_or_id"] = dataset_name_or_id
698-
kwargs["append_to_existing_dataset"] = append_to_existing_dataset
699686
if data_row_count is None:
700687
data_row_count = 100
701-
if data_row_count < 0:
702-
raise ValueError("data_row_count must be a positive integer.")
703-
kwargs["data_row_count"] = data_row_count
704688
warnings.warn(
705689
"Automatic generation of data rows of live model evaluation projects is deprecated. dataset_name_or_id, append_to_existing_dataset, data_row_count will be removed in a future version.",
706690
DeprecationWarning,

libs/labelbox/src/labelbox/project_validation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def validate_fields(self):
6969
is_consensus_enabled=True,
7070
)
7171

72+
if self.data_row_count is not None and self.data_row_count < 0:
73+
raise ValueError("data_row_count must be a positive integer.")
74+
7275
return self
7376

7477
def _set_quality_mode_attributes(

libs/labelbox/tests/integration/test_labeling_service.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
from lbox.exceptions import (
33
LabelboxError,
4-
MalformedQueryException,
54
ResourceNotFoundError,
65
)
76

@@ -54,7 +53,7 @@ def test_request_labeling_service_moe_project(
5453

5554
labeling_service = project.get_labeling_service()
5655
with pytest.raises(
57-
MalformedQueryException,
56+
LabelboxError,
5857
match='[{"errorType":"PROJECT_MODEL_CONFIG","errorMessage":"Project model config is not completed"}]',
5958
):
6059
labeling_service.request()
@@ -76,5 +75,5 @@ def test_request_labeling_service_incomplete_requirements(ontology, project):
7675
): # No labeling service by default
7776
labeling_service.request()
7877
project.connect_ontology(ontology)
79-
with pytest.raises(MalformedQueryException):
78+
with pytest.raises(LabelboxError):
8079
labeling_service.request()

0 commit comments

Comments
 (0)