fix: check model is loaded before starting #2206
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This pull request introduces several updates to improve logging, enhance functionality, and fix redundant or unnecessary code in the engine's configuration, extensions, and services. Key changes include refining logging levels, adding new parameters for model handling, and addressing redundant variable declarations.
Logging Improvements:
CTL_DBG
toCTL_TRC
inYamlHandler::ReadYamlFile
to reduce verbosity for debug-level logs and align with trace-level logging. (engine/config/yaml_config.cc
, engine/config/yaml_config.ccL51-R51)New Features:
ignore_eos
parameter inConvertJsonToParamsVector
, allowing the engine to ignore end-of-sequence tokens during processing. (engine/extensions/local-engine/local_engine.cc
, engine/extensions/local-engine/local_engine.ccR83-R87)LoadModel
to check if a model is already loaded. If so, it logs a warning, returns a 409 error status, and avoids redundant loading. (engine/extensions/local-engine/local_engine.cc
, engine/extensions/local-engine/local_engine.ccR510-R526)Code Simplification:
model_author
inModelSourceService::AddCortexsoRepo
to streamline the logic and improve readability. (engine/services/model_source_service.cc
, engine/services/model_source_service.ccL436-R436)Parameter Updates:
--jinja
parameter to theLoadModel
method, enabling additional functionality for Jinja template processing. (engine/extensions/local-engine/local_engine.cc
, engine/extensions/local-engine/local_engine.ccR567-R568)Fixes Issues
Self Checklist