Added exception catch to Ollama's output in case it can't decode message
This commit is contained in:
parent
ff927d6c77
commit
ed54b2846a
@ -19,10 +19,13 @@ overrides = {}
|
|||||||
def log_output(pipe):
|
def log_output(pipe):
|
||||||
with open(os.path.join(data_dir, 'tmp.log'), 'a') as f:
|
with open(os.path.join(data_dir, 'tmp.log'), 'a') as f:
|
||||||
with pipe:
|
with pipe:
|
||||||
for line in iter(pipe.readline, ''):
|
try:
|
||||||
print(line, end='')
|
for line in iter(pipe.readline, ''):
|
||||||
f.write(line)
|
print(line, end='')
|
||||||
f.flush()
|
f.write(line)
|
||||||
|
f.flush()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
if not os.path.isdir(os.path.join(cache_dir, 'tmp/ollama')):
|
if not os.path.isdir(os.path.join(cache_dir, 'tmp/ollama')):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user