Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions gaianet
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ update_config() {
# start rag-api-server and a qdrant instance
start() {
local_only=$1
force_rag=$2
log_dir=$gaianet_base_dir/log
if ! [ -d "$log_dir" ]; then
mkdir -p -m777 $log_dir
Expand All @@ -615,7 +616,7 @@ start() {
fi

snapshot=$(awk -F'"' '/"snapshot":/ {print $4}' $gaianet_base_dir/config.json)
if [ -n "$snapshot" ]; then
if [ -n "$snapshot" ] || [ "$force_rag" = true ]; then
# 1. start a Qdrant instance
printf "[+] Starting Qdrant instance ...\n"

Expand Down Expand Up @@ -1421,6 +1422,7 @@ show_start_help() {
printf "Options:\n"
printf " --local-only Start the program in local mode.\n"
printf " --base <path> The base directory of GaiaNet.\n"
printf " --force-rag Force start rag-api-server even if the 'snapshot' field of config.json is empty. Users should ensure the qdrant has been initialized with the desired snapshot.\n"
printf " --help Show this help message\n\n"
}

Expand Down Expand Up @@ -1864,6 +1866,8 @@ case $subcommand in
run|start)
local=0

force_rag=false

while (( "$#" )); do
case "$1" in
--local-only)
Expand All @@ -1877,14 +1881,18 @@ case $subcommand in
check_base_dir
fi
;;
--force-rag)
force_rag=true
shift
;;
*)
show_start_help
exit 1
;;
esac
done

start $local
start $local $force_rag

;;

Expand Down
Loading