@@ -371,7 +371,7 @@ def download_project_data(
371
371
# Download deployment
372
372
if include_deployment :
373
373
logging .info ("Creating deployment for project..." )
374
- self .deploy_project (project , output_folder = target_folder )
374
+ self .deploy_project (project = project , output_folder = target_folder )
375
375
376
376
logging .info (f"Project '{ project .name } ' was downloaded successfully." )
377
377
return project
@@ -1132,7 +1132,8 @@ def upload_and_predict_video(
1132
1132
1133
1133
def deploy_project (
1134
1134
self ,
1135
- project : Project ,
1135
+ project : Optional [Project ] = None ,
1136
+ project_name : Optional [str ] = None ,
1136
1137
output_folder : Optional [Union [str , os .PathLike ]] = None ,
1137
1138
models : Optional [Sequence [BaseModel ]] = None ,
1138
1139
enable_explainable_ai : bool = False ,
@@ -1147,7 +1148,10 @@ def deploy_project(
1147
1148
for each task in the project. However, it is possible to specify a particular
1148
1149
model to use, by passing it in the list of `models` as input to this method.
1149
1150
1150
- :param project: Project object to deploy
1151
+ :param project: Project object to deploy. Either `project` or `project_name`
1152
+ must be specified.
1153
+ :param project_name: Name of the project to deploy. Either `project` or
1154
+ `project_name` must be specified.
1151
1155
:param output_folder: Path to a folder on local disk to which the Deployment
1152
1156
should be downloaded. If no path is specified, the deployment will not be
1153
1157
saved.
@@ -1165,6 +1169,11 @@ def deploy_project(
1165
1169
launch an OVMS container serving the models.
1166
1170
:return: Deployment for the project
1167
1171
"""
1172
+ if project is None and project_name is None :
1173
+ raise ValueError ("Either `project` or `project_name` must be specified." )
1174
+ if project is None :
1175
+ project = self .project_client .get_project_by_name (project_name = project_name )
1176
+
1168
1177
deployment_client = self ._deployment_clients .get (project .id , None )
1169
1178
if deployment_client is None :
1170
1179
# Create deployment client and add to cache.
0 commit comments