optimize_gguf.py: add alternative ollama model dir#1
Open
DronNick wants to merge 1 commit into
Open
Conversation
Reviewer's GuideEnhanced GGUFOptimizer to detect and choose between user and system 'ollama' model directories at initialization Class diagram for updated GGUFOptimizer initializationclassDiagram
class GGUFOptimizer {
+Path ollama_models_dir
+Path blobs_dir
+Path manifests_dir
GGUFOptimizer()
}
GGUFOptimizer : ollama_models_dir is set to user or system model dir based on existence
GGUFOptimizer : blobs_dir = ollama_models_dir / "blobs"
GGUFOptimizer : manifests_dir = ollama_models_dir / "manifests"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @DronNick - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `optimize_gguf.py:29` </location>
<code_context>
+ if home_models_dir.is_dir() and any(home_models_dir.iterdir()):
+ self.ollama_models_dir = home_models_dir
+ else:
+ self.ollama_models_dir = Path("/usr/share/ollama") / ".ollama" / "models"
self.blobs_dir = self.ollama_models_dir / "blobs"
self.manifests_dir = self.ollama_models_dir / "manifests"
</code_context>
<issue_to_address>
Hardcoding the fallback path may reduce portability.
Consider making the fallback path configurable or verifying its existence before assignment to improve portability across different systems.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| if home_models_dir.is_dir() and any(home_models_dir.iterdir()): | ||
| self.ollama_models_dir = home_models_dir | ||
| else: | ||
| self.ollama_models_dir = Path("/usr/share/ollama") / ".ollama" / "models" |
There was a problem hiding this comment.
suggestion: Hardcoding the fallback path may reduce portability.
Consider making the fallback path configurable or verifying its existence before assignment to improve portability across different systems.
Author
|
Hi @OJamals , I just wanted to kindly check in on my pull request (cameroncooke/reloaderoo#1). Please let me know if any changes are needed. Thanks! |
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.
On hosts with ollama running as service the model directory is not in users home, but in ollama service home.
Summary by Sourcery
Enhancements: