feat(api): extend /api/health with model load diagnostics#28
Open
Swatikantamishra8 wants to merge 2 commits intoClimate-Vision:mainfrom
Open
feat(api): extend /api/health with model load diagnostics#28Swatikantamishra8 wants to merge 2 commits intoClimate-Vision:mainfrom
Swatikantamishra8 wants to merge 2 commits intoClimate-Vision:mainfrom
Conversation
Closes Climate-Vision#20 - Try to load each enabled model via _load_model() - Report loaded status, checkpoint path, and any errors - Return model_diagnostics dict in health response - Mark health as degraded if any model fails to load
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #20
Extends the
/api/healthendpoint to report per-model load status, addressing the feature request in issue #20.Changes
model_diagnosticsdict to/api/healthresponse_load_model()loaded(bool),path(checkpoint path), anderror(if any) per modeldegradedif any model fails to loadExample Response
{ "status": "ok", "version": "0.2.0", "analysis_types": ["deforestation", "ice_melt", "flooding"], "config_valid": true, "config_issues": [], "model_diagnostics": { "deforestation": {"loaded": true, "path": "models/best_model.pth", "error": null}, "ice_melt": {"loaded": false, "path": null, "error": "No checkpoint found"} } }Notes
model_diagnosticsvalues aredict[str, Any]with keys:loaded,path,errorerror: null