Skip to content

Commit ce160df

Browse files
committed
Fix Assistant
1 parent 39094fb commit ce160df

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="text2text",
8-
version="1.6.6",
8+
version="1.6.7",
99
author="artitw",
1010
author_email="artitw@gmail.com",
1111
description="Text2Text: Crosslingual NLP/G toolkit",

text2text/assistant.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
import os
22
import ollama
3-
import psutil
43
import time
54
import subprocess
65
import warnings
7-
import requests
8-
9-
import text2text as t2t
106

117
from llama_index.llms.ollama import Ollama
128
from llama_index.core.llms import ChatMessage
@@ -64,11 +60,11 @@ def load_model(self):
6460
if return_code != 0:
6561
raise Exception("Cannot install lshw.")
6662

67-
response = requests.get("https://ollama.com/install.sh")
68-
install_script = response.text
69-
result = run_sh(install_script)
70-
if result and "Install complete." not in result and "will run in CPU-only mode." not in result:
71-
raise Exception(result)
63+
result = os.system(
64+
"curl -fsSL https://ollama.com/install.sh | sh"
65+
)
66+
if result!=0:
67+
raise Exception("Cannot install ollama")
7268

7369
self.ollama_serve_proc = subprocess.Popen(["ollama", "serve"])
7470
time.sleep(1)

0 commit comments

Comments
 (0)