Skip to content

Commit

Permalink
Merge pull request #37 from zanderlewis/main
Browse files Browse the repository at this point in the history
Fix Mac and Linux Support
  • Loading branch information
Zander Lewis authored May 29, 2024
2 parents f0bb495 + b6ce3cd commit 0b4b701
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions llamascript/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
__version__ = "0.6.4"
__version__ = "0.6.5"

import asyncio
import ollama
import logging
import sys
import subprocess
import os
import platform

dbg = False

Expand Down Expand Up @@ -89,12 +90,19 @@ def CREATE_MODEL(self, filename, parameters, model_name):
)
print(f"Modelfile created.")
command = ["ollama", "create", model_name, "-f", "./Modelfile"]
process = subprocess.Popen(
command,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
creationflags=subprocess.CREATE_NO_WINDOW,
)
if platform.system() == "Windows":
process = subprocess.Popen(
command,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
creationflags=subprocess.CREATE_NO_WINDOW,
)
else:
process = subprocess.Popen(
command,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
stdout, stderr = process.communicate()
print("Model created.")

Expand Down

0 comments on commit 0b4b701

Please sign in to comment.