Skip to content

Commit 6a54b27

Browse files
author
Val Brodsky
committed
Fix for backward-compatibility
1 parent 770738f commit 6a54b27

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ def create_model_evaluation_project(
925925
self,
926926
dataset_id: Optional[str] = None,
927927
dataset_name: Optional[str] = None,
928-
data_row_count: int = 100,
928+
data_row_count: Optional[int] = None,
929929
**kwargs,
930930
) -> Project:
931931
"""
@@ -955,11 +955,11 @@ def create_model_evaluation_project(
955955
>>> This creates a new project with no data rows.
956956
957957
"""
958-
if data_row_count < 0:
959-
raise ValueError("data_row_count must be a positive integer.")
960-
961958
autogenerate_data_rows = False
962-
if dataset_id or dataset_name or data_row_count:
959+
dataset_name_or_id = None
960+
append_to_existing_dataset = None
961+
962+
if dataset_id or dataset_name:
963963
warnings.warn(
964964
"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.",
965965
DeprecationWarning,
@@ -969,23 +969,20 @@ def create_model_evaluation_project(
969969
if dataset_id:
970970
append_to_existing_dataset = True
971971
dataset_name_or_id = dataset_id
972-
warnings.warn(
973-
"Automatic generation of data rows of live model evaluation projects is deprecated. dataset_name_or_id will be removed in a future version.",
974-
DeprecationWarning,
975-
)
976972
elif dataset_name:
977973
append_to_existing_dataset = False
978974
dataset_name_or_id = dataset_name
979-
warnings.warn(
980-
"Automatic generation of data rows of live model evaluation projects is deprecated. dataset_name_or_id will be removed in a future version.",
981-
DeprecationWarning,
982-
)
983975

984-
kwargs["media_type"] = MediaType.Conversational
985976
if autogenerate_data_rows:
986977
kwargs["dataset_name_or_id"] = dataset_name_or_id
987978
kwargs["append_to_existing_dataset"] = append_to_existing_dataset
979+
if data_row_count is None:
980+
data_row_count = 100
981+
if data_row_count < 0:
982+
raise ValueError("data_row_count must be a positive integer.")
988983
kwargs["data_row_count"] = data_row_count
984+
985+
kwargs["media_type"] = MediaType.Conversational
989986
kwargs["editor_task_type"] = EditorTaskType.ModelChatEvaluation.value
990987

991988
return self._create_project(**kwargs)

0 commit comments

Comments
 (0)