@@ -190,7 +190,6 @@ SagemakerAPIServer::Handle(evhtp_request_t* req)
190190 return ;
191191 }
192192 }
193- LOG_VERBOSE (1 ) << " SageMaker MME Custom Invoke Model Path" ;
194193
195194 /* Extract targetModel to log the associated archive */
196195 const char * target_model =
@@ -649,15 +648,12 @@ SagemakerAPIServer::SageMakerMMEUnloadModel(
649648 target_model = model_name_hash;
650649 }
651650
652- {
653- std::lock_guard<std::mutex> lock (models_list_mutex_);
654- if (sagemaker_models_list_.find (model_name_hash) ==
655- sagemaker_models_list_.end ()) {
656- LOG_VERBOSE (1 ) << " Model " << target_model << " with model hash "
657- << model_name_hash << " is not loaded." << std::endl;
658- evhtp_send_reply (req, EVHTP_RES_NOTFOUND ); /* 404*/
659- return ;
660- }
651+ if (sagemaker_models_list_.find (model_name_hash) ==
652+ sagemaker_models_list_.end ()) {
653+ LOG_VERBOSE (1 ) << " Model " << target_model << " with model hash "
654+ << model_name_hash << " is not loaded." << std::endl;
655+ evhtp_send_reply (req, EVHTP_RES_NOTFOUND ); /* 404*/
656+ return ;
661657 }
662658
663659 LOG_INFO << " Unloading SageMaker TargetModel: " << target_model << std::endl;
@@ -728,11 +724,7 @@ SagemakerAPIServer::SageMakerMMEUnloadModel(
728724 " result in SageMaker UNLOAD timeout." ;
729725 }
730726
731- std::string repo_parent_path;
732- {
733- std::lock_guard<std::mutex> lock (models_list_mutex_);
734- repo_parent_path = sagemaker_models_list_.at (model_name_hash);
735- }
727+ std::string repo_parent_path = sagemaker_models_list_.at (model_name_hash);
736728
737729 TRITONSERVER_Error* unregister_err = nullptr ;
738730
@@ -750,10 +742,8 @@ SagemakerAPIServer::SageMakerMMEUnloadModel(
750742
751743 TRITONSERVER_ErrorDelete (unregister_err);
752744
753- {
754- std::lock_guard<std::mutex> lock (models_list_mutex_);
755- sagemaker_models_list_.erase (model_name_hash);
756- }
745+ std::lock_guard<std::mutex> lock (models_list_mutex_);
746+ sagemaker_models_list_.erase (model_name_hash);
757747}
758748
759749void
0 commit comments