Skip to content

Commit 0861ef0

Browse files
committed
rename model name for in memory graph
1 parent d04e75d commit 0861ef0

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/capi_frontend/server_settings.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ enum OvmsServerMode : int {
9090
HF_PULL_AND_START_MODE,
9191
LIST_MODELS_MODE,
9292
MODIFY_CONFIG_MODE,
93-
GENAI_CONFIGURE_AND_START,
93+
IN_MEMORY_GRAPH_MODE,
9494
UNKNOWN_MODE
9595
};
9696

src/cli_parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ void CLIParser::prepareGraph(ServerSettingsImpl& serverSettings, HFSettingsImpl&
711711
// Ovms Pull models mode || pull and start models mode
712712
if (isHFPullOrPullAndStart(this->result) || isGenAIConfigureAndStart(this->result)) {
713713
if (isGenAIConfigureAndStart(this->result)) {
714-
serverSettings.serverMode = GENAI_CONFIGURE_AND_START;
714+
serverSettings.serverMode = IN_MEMORY_GRAPH_MODE;
715715
} else if (result->count("pull")) {
716716
serverSettings.serverMode = HF_PULL_MODE;
717717
} else {

src/config.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ bool Config::validate() {
152152
std::cerr << "--source_model should be used combined with --task" << std::endl;
153153
return false;
154154
}
155-
if (this->serverSettings.serverMode == HF_PULL_MODE || this->serverSettings.serverMode == HF_PULL_AND_START_MODE || this->serverSettings.serverMode == GENAI_CONFIGURE_AND_START) {
155+
if (this->serverSettings.serverMode == HF_PULL_MODE || this->serverSettings.serverMode == HF_PULL_AND_START_MODE || this->serverSettings.serverMode == IN_MEMORY_GRAPH_MODE) {
156156
// When --task is used with --model_path (no HF pulling), sourceModel and downloadPath are not required
157-
bool taskWithModelPath = this->serverSettings.serverMode == GENAI_CONFIGURE_AND_START && !this->modelsSettings.modelPath.empty();
157+
bool taskWithModelPath = this->serverSettings.serverMode == IN_MEMORY_GRAPH_MODE && !this->modelsSettings.modelPath.empty();
158158
if (!taskWithModelPath) {
159159
if (!serverSettings.hfSettings.sourceModel.size()) {
160160
std::cerr << "source_model parameter is required for pull mode";

src/mediapipe_internal/mediapipegraphdefinition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const tensor_map_t MediapipeGraphDefinition::getOutputsInfo() const {
6262
}
6363

6464
Status MediapipeGraphDefinition::validateForConfigFileExistence() {
65-
if (GraphExport::hasInMemoryGraphContent() && ovms::Config::instance().getServerSettings().serverMode == GENAI_CONFIGURE_AND_START) {
65+
if (GraphExport::hasInMemoryGraphContent() && ovms::Config::instance().getServerSettings().serverMode == IN_MEMORY_GRAPH_MODE) {
6666
const std::string& content = GraphExport::getInMemoryGraphContent();
6767
this->chosenConfig = content;
6868
this->mgconfig.setCurrentGraphPbTxtMD5(ovms::FileSystem::getStringMD5(content));

src/modelmanager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Status ModelManager::startFromConfig() {
229229

230230
std::vector<MediapipeGraphConfig> mediapipesInConfigFile;
231231
std::ifstream ifs(mpConfig.getGraphPath());
232-
bool graphAvailable = ifs.is_open() || (GraphExport::hasInMemoryGraphContent() && config.getServerSettings().serverMode == GENAI_CONFIGURE_AND_START);
232+
bool graphAvailable = ifs.is_open() || (GraphExport::hasInMemoryGraphContent() && config.getServerSettings().serverMode == IN_MEMORY_GRAPH_MODE);
233233
if (graphAvailable) {
234234
// Single model with graph.pbtxt, check if user passed model unsupported model parameters in cmd arguments
235235
status = ModelManager::validateUserSettingsInSingleModelCliGraphStart(config.getModelSettings());
@@ -408,7 +408,7 @@ bool ModelManager::CheckStartFromGraph(std::string inputPath, MediapipeGraphConf
408408
SPDLOG_LOGGER_DEBUG(modelmanager_logger, "Graph: {} path: {} exists", mpConfig.getGraphName(), mpConfig.getGraphPath());
409409
return true;
410410
}
411-
if (GraphExport::hasInMemoryGraphContent() && Config::instance().getServerSettings().serverMode == GENAI_CONFIGURE_AND_START) {
411+
if (GraphExport::hasInMemoryGraphContent() && Config::instance().getServerSettings().serverMode == IN_MEMORY_GRAPH_MODE) {
412412
SPDLOG_LOGGER_DEBUG(modelmanager_logger, "Graph: {} using in-memory graph content", mpConfig.getGraphName());
413413
return true;
414414
}

src/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Status Server::startModules(ovms::Config& config) {
424424
if (!status.ok())
425425
return status;
426426
}
427-
if (config.getServerSettings().serverMode == GENAI_CONFIGURE_AND_START) {
427+
if (config.getServerSettings().serverMode == IN_MEMORY_GRAPH_MODE) {
428428
// --task with --model_path: create graph in memory without HF download
429429
GraphExport graphExporter;
430430
const auto& hfSettings = config.getServerSettings().hfSettings;
@@ -546,7 +546,7 @@ int Server::startServerFromSettings(ServerSettingsImpl& serverSettings, ModelsSe
546546
return statusToExitCode(ret);
547547
}
548548
while (!getShutdownStatus() &&
549-
(serverSettings.serverMode == HF_PULL_AND_START_MODE || serverSettings.serverMode == SERVING_MODELS_MODE || serverSettings.serverMode == GENAI_CONFIGURE_AND_START)) {
549+
(serverSettings.serverMode == HF_PULL_AND_START_MODE || serverSettings.serverMode == SERVING_MODELS_MODE || serverSettings.serverMode == IN_MEMORY_GRAPH_MODE)) {
550550
std::this_thread::sleep_for(std::chrono::milliseconds(200));
551551
}
552552
} catch (const std::exception& e) {

0 commit comments

Comments
 (0)