Skip to content

Commit 77b31a4

Browse files
author
Val Brodsky
committed
PR feedback
Docstring updates
1 parent 115b78d commit 77b31a4

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,6 @@ def create_dataset(self,
717717
raise e
718718
return dataset
719719

720-
# **** Create Project begin ****
721-
722720
def create_project(self, **kwargs) -> Project:
723721
""" Creates a Project object on the server.
724722
@@ -744,10 +742,11 @@ def create_project(self, **kwargs) -> Project:
744742
InvalidAttributeError: If the Project type does not contain
745743
any of the attribute names given in kwargs.
746744
747-
NOTE: the following attributes are used only chat model evaluation projects:
745+
NOTE: the following attributes are used only in chat model evaluation projects:
748746
dataset_name_or_id, append_to_existing_dataset, data_row_count, editor_task_type
749747
They are not used for general projects and not supported in this method
750748
"""
749+
# The following arguments are not supported for general projects, only for chat model evaluation projects
751750
kwargs.pop("dataset_name_or_id", None)
752751
kwargs.pop("append_to_existing_dataset", None)
753752
kwargs.pop("data_row_count", None)
@@ -823,21 +822,26 @@ def create_model_evaluation_project(self,
823822
return self._create_project(**kwargs)
824823

825824
def create_offline_model_evaluation_project(self, **kwargs) -> Project:
826-
kwargs["media_type"] = MediaType.Conversational
825+
"""
826+
Creates a project for offline model evaluation.
827+
Args:
828+
**kwargs: Additional parameters to pass see the create_project method
829+
Returns:
830+
Project: The created project
831+
"""
827832
kwargs[
828-
"editor_task_type"] = EditorTaskType.OfflineModelChatEvaluation.value
833+
"media_type"] = MediaType.Conversational # Only Conversational is supported
834+
kwargs[
835+
"editor_task_type"] = EditorTaskType.OfflineModelChatEvaluation.value # Special editor task type for offline model evaluation
836+
837+
# The following arguments are not supported for offline model evaluation
829838
kwargs.pop("dataset_name_or_id", None)
830839
kwargs.pop("append_to_existing_dataset", None)
831840
kwargs.pop("data_row_count", None)
832841

833842
return self.create_project(**kwargs)
834843

835844
def _create_project(self, **kwargs) -> Project:
836-
"""
837-
Internal method to create a project with the given parameters.
838-
Args: see other create_project methods
839-
NOTE: do not use this method directly. Use create_project* methods instead.
840-
"""
841845
auto_audit_percentage = kwargs.get("auto_audit_percentage")
842846
auto_audit_number_of_labels = kwargs.get("auto_audit_number_of_labels")
843847
if auto_audit_percentage is not None or auto_audit_number_of_labels is not None:
@@ -903,9 +907,6 @@ def _create_project(self, **kwargs) -> Project:
903907

904908
return self._create(Entity.Project, params, extra_params)
905909

906-
907-
# **** Create Project end ****
908-
909910
def get_roles(self) -> List[Role]:
910911
"""
911912
Returns:

0 commit comments

Comments
 (0)