create models home if it does not exist
This commit is contained in:
parent
28b47e6068
commit
e4bdacb152
1 changed files with 5 additions and 0 deletions
|
@ -11,6 +11,11 @@ def main():
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
parser.add_argument("--models-home", default=Path.home() / ".ollama" / "models")
|
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()
|
subparsers = parser.add_subparsers()
|
||||||
|
|
||||||
server.set_parser(subparsers.add_parser("serve"))
|
server.set_parser(subparsers.add_parser("serve"))
|
||||||
|
|
Loading…
Reference in a new issue