@@ -787,8 +787,10 @@ def deploy_model(
787787 filename (str, optional): The name of the weights file. Defaults to "weights/best.pt".
788788 """
789789
790- from roboflow .util .model_processor import process , validate_model_type_for_project
791- from roboflow .util .versions import normalize_yolo_model_type
790+ from roboflow .util .model_processor import (
791+ package_custom_weights_interactive ,
792+ validate_model_type_for_project ,
793+ )
792794
793795 if not project_ids :
794796 raise ValueError ("At least one project ID must be provided" )
@@ -800,16 +802,12 @@ def deploy_model(
800802 if project_id not in projects_by_id :
801803 raise ValueError (f"Project { project_id } is not accessible in this workspace" )
802804
803- model_type = normalize_yolo_model_type (model_type )
804- zip_file_name , model_type = process (model_type , model_path , filename )
805-
806- if zip_file_name is None :
807- raise RuntimeError ("Failed to process model" )
805+ bundle = package_custom_weights_interactive (model_type , model_path , filename , build_dir = model_path )
808806
809807 for project_id in project_ids :
810- validate_model_type_for_project (model_type , projects_by_id [project_id ].get ("type" , "" ), project_id )
808+ validate_model_type_for_project (bundle . model_type , projects_by_id [project_id ].get ("type" , "" ), project_id )
811809
812- self ._upload_zip (model_type , model_path , project_ids , model_name , zip_file_name )
810+ self ._upload_zip (bundle . model_type , model_path , project_ids , model_name , bundle . archive_path . name )
813811
814812 def _upload_zip (
815813 self ,
0 commit comments