Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion optimize_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@

class GGUFOptimizer:
def __init__(self):
self.ollama_models_dir = Path.home() / ".ollama" / "models"
home_models_dir = Path.home() / ".ollama" / "models"
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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

self.blobs_dir = self.ollama_models_dir / "blobs"
self.manifests_dir = self.ollama_models_dir / "manifests"

Expand Down