fix: pass project_root instead of checkpoint dir to initialize_service#637
Merged
fix: pass project_root instead of checkpoint dir to initialize_service#637
Conversation
init_service_wrapper was passing the checkpoint dropdown value (the full checkpoints directory path, e.g. '<project>/checkpoints') as the project_root argument to initialize_service(). This caused initialize_service to append 'checkpoints' again, resulting in '<project>/checkpoints/checkpoints' — triggering unnecessary model re-downloads into the nested directory. Fix: derive project_root from __file__ (consistent with the LLM init path that was already correct) instead of using the checkpoint dropdown value. Adds unit tests verifying the project_root is never the checkpoints dir.
Contributor
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR refactors path derivation in the service initialization module to compute Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
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.
init_service_wrapper was passing the checkpoint dropdown value (the full checkpoints directory path, e.g. '/checkpoints') as the project_root argument to initialize_service(). This caused initialize_service to append 'checkpoints' again, resulting in '/checkpoints/checkpoints' — triggering unnecessary model re-downloads into the nested directory.
Fix: derive project_root from file (consistent with the LLM init path that was already correct) instead of using the checkpoint dropdown value.
Adds unit tests verifying the project_root is never the checkpoints dir.
Summary by CodeRabbit
Refactor
Tests