MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetFullModelVersion

Method GetFullModelVersion

serving/processor/storage/model_store.cc:92–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92Status ModelStore::GetFullModelVersion(Version& version) {
93 TF_RETURN_IF_ERROR(DetectLatestCheckpointDir());
94 TF_RETURN_IF_ERROR(file_system_->IsDirectory(checkpoint_dir_));
95
96 std::vector<string> file_names;
97 TF_RETURN_IF_ERROR(file_system_->GetChildren(checkpoint_dir_,
98 &file_names));
99
100 for (auto fname : file_names) {
101 if (IsIncrementalCkptPath(fname) ||
102 !IsMetaFileName(fname)) {
103 continue;
104 }
105
106 auto v = ParseMetaFileName(fname);
107 if (v > version.full_ckpt_version) {
108 version.full_ckpt_name = ParseCkptFileName(checkpoint_dir_, fname);
109 version.full_ckpt_version = v;
110 }
111 }
112 return Status::OK();
113}
114
115Status ModelStore::GetDeltaModelVersion(Version& version) {
116 delta_model_dir_ = io::JoinPath(checkpoint_dir_, ".incremental_checkpoint");

Callers

nothing calls this directly

Calls 6

IsIncrementalCkptPathFunction · 0.85
IsMetaFileNameFunction · 0.85
ParseMetaFileNameFunction · 0.85
ParseCkptFileNameFunction · 0.85
IsDirectoryMethod · 0.45
GetChildrenMethod · 0.45

Tested by

no test coverage detected