Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to add models loaded dynamically #340

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/model_repository_manager/model_repository_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,8 @@ Status
ModelRepositoryManager::RepositoryIndex(
const bool ready_only, std::vector<ModelIndex>* index)
{
std::set<ModelIdentifier> seen_models;
std::set<ModelIdentifier> duplicate_models;
std::unordered_set<ModelIdentifier> seen_models;
std::unordered_set<ModelIdentifier> duplicate_models;
for (const auto& repository_path : repository_paths_) {
const std::string model_namespace =
(enable_model_namespacing_ ? repository_path : "");
Expand Down Expand Up @@ -1059,6 +1059,18 @@ ModelRepositoryManager::RepositoryIndex(
}
}

// Any loaded models which are
// not present in the local model repository
// are added to the index directly

for (const auto& mapping_it : global_map_) {
for (const auto& model_id : mapping_it.second) {
if (seen_models.count(model_id) == 0) {
seen_models.insert(model_id);
}
}
}

ModelStateMap states = ModelStates();

for (const auto& model_id : seen_models) {
Expand Down
Loading