From e4bdacb152c7a836e6712a8868bb40f2ca2de077 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Thu, 29 Jun 2023 15:20:08 -0400 Subject: [PATCH] create models home if it does not exist --- ollama/cmd/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ollama/cmd/cli.py b/ollama/cmd/cli.py index 2e50dc3e..ea12e743 100644 --- a/ollama/cmd/cli.py +++ b/ollama/cmd/cli.py @@ -11,6 +11,11 @@ def main(): parser = ArgumentParser() parser.add_argument("--models-home", default=Path.home() / ".ollama" / "models") + # create models home if it doesn't exist + models_home = parser.parse_known_args()[0].models_home + if not models_home.exists(): + os.makedirs(models_home) + subparsers = parser.add_subparsers() server.set_parser(subparsers.add_parser("serve"))