diff --git a/setup.py b/setup.py index 0393f2b..33e1681 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="text2text", - version="1.6.4", + version="1.6.5", author="artitw", author_email="artitw@gmail.com", description="Text2Text: Crosslingual NLP/G toolkit", diff --git a/text2text/__init__.py b/text2text/__init__.py index 8c6e6f8..4be0dd8 100755 --- a/text2text/__init__.py +++ b/text2text/__init__.py @@ -14,4 +14,3 @@ from .identifier import Identifier from .server import Server from .handler import Handler -from . import utils \ No newline at end of file diff --git a/text2text/assistant.py b/text2text/assistant.py index a3707ad..8e24ee0 100644 --- a/text2text/assistant.py +++ b/text2text/assistant.py @@ -4,7 +4,7 @@ import time import subprocess import warnings -import importlib.resources +import requests import text2text as t2t @@ -64,12 +64,11 @@ def load_model(self): if return_code != 0: raise Exception("Cannot install lshw.") - inp_file = importlib.resources.files(t2t.utils) / 'ollama_install.sh' - with inp_file.open("rt") as f: - install_script = f.read() - result = run_sh(install_script) - if "Install complete." not in result and "will run in CPU-only mode." not in result: - raise Exception(result) + response = requests.get("https://ollama.com/install.sh") + install_script = response.text + result = run_sh(install_script) + if "Install complete." not in result and "will run in CPU-only mode." not in result: + raise Exception(result) self.ollama_serve_proc = subprocess.Popen(["ollama", "serve"]) time.sleep(1)