File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ constexpr char kAutoMixedPrecisionExecutionAccelerator[] =
7171 " auto_mixed_precision" ;
7272
7373constexpr char kModelConfigPbTxt [] = " config.pbtxt" ;
74+ constexpr char kModelCard [] = " README.md" ;
7475
7576constexpr char kMetricsLabelModelName [] = " model" ;
7677constexpr char kMetricsLabelModelVersion [] = " version" ;
Original file line number Diff line number Diff line change 3636
3737namespace triton { namespace core {
3838
39+ Status
40+ Model::GetCard (std::string* contents) const
41+ {
42+ const auto card_path = JoinPath ({model_dir_, kModelCard });
43+ RETURN_IF_ERROR (ReadTextFile (card_path, contents));
44+
45+ return Status::Success;
46+ }
47+
3948Status
4049Model::GetInput (
4150 const std::string& name, const inference::ModelInput** input) const
Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ class Model {
146146 return stats_aggregator_;
147147 }
148148
149+ // Get the model card for the model being served.
150+ Status GetCard (std::string* contents) const ;
151+
149152 // Get the model configuration for a named input.
150153 Status GetInput (
151154 const std::string& name, const inference::ModelInput** input) const ;
Original file line number Diff line number Diff line change @@ -2634,6 +2634,13 @@ TRITONSERVER_ServerModelMetadata(
26342634 metadata.AddStringRef (" platform" , model_config.backend ().c_str ()));
26352635 }
26362636
2637+ std::string card;
2638+ model->GetCard (&card);
2639+ if (!card.empty ()) {
2640+ RETURN_IF_STATUS_ERROR (
2641+ metadata.AddStringRef (" card" , card.c_str ()));
2642+ }
2643+
26372644 triton::common::TritonJson::Value inputs (
26382645 metadata, triton::common::TritonJson::ValueType::ARRAY);
26392646 for (const auto & io : model_config.input ()) {
You can’t perform that action at this time.
0 commit comments