File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -2005,6 +2005,29 @@ ModelState::ValidateModelConfig()
20052005 return nullptr ;
20062006}
20072007
2008+ TRITONSERVER_Error*
2009+ ModelState::SetModelConfig ()
2010+ {
2011+ BackendModel::SetModelConfig ();
2012+ // `Update model_transaction_policy` if setting was set
2013+ // with `set_model_transaction_policy`
2014+ triton::common::TritonJson::Value model_transaction_policy;
2015+ bool is_decoupled = false ;
2016+ if (ModelConfig ().Find (
2017+ " model_transaction_policy" , &model_transaction_policy)) {
2018+ triton::common::TritonJson::Value decoupled;
2019+ if (model_transaction_policy.Find (" decoupled" , &decoupled)) {
2020+ auto error = decoupled.AsBool (&is_decoupled);
2021+ if (error != nullptr ) {
2022+ throw BackendModelException (error);
2023+ }
2024+ SetDecoupled (is_decoupled);
2025+ }
2026+ }
2027+
2028+ return nullptr ;
2029+ }
2030+
20082031
20092032extern " C" {
20102033
Original file line number Diff line number Diff line change @@ -238,6 +238,9 @@ class ModelState : public BackendModel {
238238 // Is decoupled API being used.
239239 bool IsDecoupled () { return decoupled_; }
240240
241+ // Set decoupled mode
242+ void SetDecoupled (bool decoupled) { decoupled_ = decoupled; }
243+
241244 // Returns the value in the `runtime_modeldir_` field
242245 std::string RuntimeModelDir () { return runtime_modeldir_; }
243246
@@ -247,6 +250,10 @@ class ModelState : public BackendModel {
247250 // Validate Model Configuration
248251 TRITONSERVER_Error* ValidateModelConfig ();
249252
253+ // Overrides `BackendModel::SetModelConfig` to also
254+ // set `ModelState::decoupled_`
255+ TRITONSERVER_Error* SetModelConfig ();
256+
250257 // Auto-complete stub
251258 std::unique_ptr<StubLauncher>& Stub () { return auto_complete_stub_; }
252259
Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ def add_input(self, input):
394394 + input ["name" ]
395395 + "' in auto-complete-config function for model '"
396396 + self ._model_config ["name" ]
397- + "' contains property other than 'name', 'data_type' and 'dims '."
397+ + "' contains property other than 'name', 'data_type', 'dims' and 'optional '."
398398 )
399399
400400 if "name" not in input :
You can’t perform that action at this time.
0 commit comments