koboldai: use multiple --replace instead of calling substituteInPlace multiple times

This commit is contained in:
matthewcroughan 2023-02-28 16:42:29 +00:00
parent 54be1bf0c9
commit cad8af64b6

View file

@ -49,10 +49,11 @@ let
cd src cd src
rm -rf models settings userscripts rm -rf models settings userscripts
cd - cd -
substituteInPlace ./src/aiserver.py --replace 'os.system("")' 'STATE_DIR = os.path.expandvars("${stateDir}")' substituteInPlace ./src/aiserver.py \
substituteInPlace ./src/aiserver.py --replace 'cache_dir="cache"' "cache_dir=os.path.join(STATE_DIR, 'cache')" --replace 'os.system("")' 'STATE_DIR = os.path.expandvars("${stateDir}")' \
substituteInPlace ./src/aiserver.py --replace 'shutil.rmtree("cache/")' 'shutil.rmtree(os.path.join(STATE_DIR, "cache"))' --replace 'cache_dir="cache"' "cache_dir=os.path.join(STATE_DIR, 'cache')" \
substituteInPlace ./src/aiserver.py --replace "app.config['SESSION_TYPE'] = 'filesystem'" "app.config['SESSION_TYPE'] = 'memcached'" --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 # 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 # Typo in casing by author means that breakmodels crash the program, but