Skip to content

Commit

Permalink
feat: add context_window to config.json if use --upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Xin Liu <sam@secondstate.io>
  • Loading branch information
apepkuss committed Dec 19, 2024
1 parent c7b164f commit 50d081b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ if [ -d "$gaianet_base_dir" ]; then
if [ -f "$gaianet_base_dir/config.json" ]; then
printf " * Copy config.json to $gaianet_base_dir/backup/\n"
cp $gaianet_base_dir/config.json $gaianet_base_dir/backup/

# check if context_window is present in config.json
if ! grep -q '"context_window":' config.json; then
sed_in_place '2i\
"context_window": "1",
' "$gaianet_base_dir/config.json"
fi

else
error "Failed to copy the config.json. Reason: the config.json does not exist in $gaianet_base_dir."
exit 1
Expand Down

0 comments on commit 50d081b

Please sign in to comment.