File tree 4 files changed +20
-0
lines changed
4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ constexpr char kAutoMixedPrecisionExecutionAccelerator[] =
71
71
" auto_mixed_precision" ;
72
72
73
73
constexpr char kModelConfigPbTxt [] = " config.pbtxt" ;
74
+ constexpr char kModelCard [] = " README.md" ;
74
75
75
76
constexpr char kMetricsLabelModelName [] = " model" ;
76
77
constexpr char kMetricsLabelModelVersion [] = " version" ;
Original file line number Diff line number Diff line change 36
36
37
37
namespace triton { namespace core {
38
38
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
+
39
48
Status
40
49
Model::GetInput (
41
50
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 {
146
146
return stats_aggregator_;
147
147
}
148
148
149
+ // Get the model card for the model being served.
150
+ Status GetCard (std::string* contents) const ;
151
+
149
152
// Get the model configuration for a named input.
150
153
Status GetInput (
151
154
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(
2634
2634
metadata.AddStringRef (" platform" , model_config.backend ().c_str ()));
2635
2635
}
2636
2636
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
+
2637
2644
triton::common::TritonJson::Value inputs (
2638
2645
metadata, triton::common::TritonJson::ValueType::ARRAY);
2639
2646
for (const auto & io : model_config.input ()) {
You can’t perform that action at this time.
0 commit comments