From cad8af64b68d22d40492707cf9bfae891645dcc5 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Tue, 28 Feb 2023 16:42:29 +0000 Subject: [PATCH] koboldai: use multiple --replace instead of calling substituteInPlace multiple times --- projects/koboldai/package.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/koboldai/package.nix b/projects/koboldai/package.nix index 5028999..5d1ed5e 100644 --- a/projects/koboldai/package.nix +++ b/projects/koboldai/package.nix @@ -49,10 +49,11 @@ let cd src rm -rf models settings userscripts cd - - substituteInPlace ./src/aiserver.py --replace 'os.system("")' 'STATE_DIR = os.path.expandvars("${stateDir}")' - substituteInPlace ./src/aiserver.py --replace 'cache_dir="cache"' "cache_dir=os.path.join(STATE_DIR, 'cache')" - substituteInPlace ./src/aiserver.py --replace 'shutil.rmtree("cache/")' 'shutil.rmtree(os.path.join(STATE_DIR, "cache"))' - substituteInPlace ./src/aiserver.py --replace "app.config['SESSION_TYPE'] = 'filesystem'" "app.config['SESSION_TYPE'] = 'memcached'" + substituteInPlace ./src/aiserver.py \ + --replace 'os.system("")' 'STATE_DIR = os.path.expandvars("${stateDir}")' \ + --replace 'cache_dir="cache"' "cache_dir=os.path.join(STATE_DIR, 'cache')" \ + --replace 'shutil.rmtree("cache/")' 'shutil.rmtree(os.path.join(STATE_DIR, "cache"))' \ + --replace "app.config['SESSION_TYPE'] = 'filesystem'" "app.config['SESSION_TYPE'] = 'memcached'" # https://stackoverflow.com/questions/59433832/runtimeerror-only-tensors-of-floating-point-dtype-can-require-gradients # Typo in casing by author means that breakmodels crash the program, but