Skip to content

Commit

Permalink
feat: support new server-assistant
Browse files Browse the repository at this point in the history
Signed-off-by: Xin Liu <[email protected]>
  • Loading branch information
apepkuss committed Oct 9, 2024
1 parent d15193f commit eeed0e7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions gaianet
Original file line number Diff line number Diff line change
Expand Up @@ -1173,23 +1173,22 @@ start() {
printf "[+] Starting Server Assistant ...\n\n"
sleep 2

# parse server_health_url
server_health_url=$(awk -F'"' '/"server_health_url":/ {print $4}' $gaianet_base_dir/config.json)
# check if server_health_url is empty
if [ -z "$server_health_url" ]; then
error " * server_health_url is empty. Exiting ..."
# parse domain
domain=$(awk -F'"' '/"domain":/ {print $4}' $gaianet_base_dir/config.json)
# check if domain is empty
if [ -z "$domain" ]; then
error " * domain is empty. Exiting ..."

# stop the running services
stop_force

exit 1
fi

# parse server_info_url
server_info_url=$(awk -F'"' '/"server_info_url":/ {print $4}' $gaianet_base_dir/config.json)
# check if server_info_url is empty
if [ -z "$server_info_url" ]; then
error " * server_info_url is empty. Exiting ..."
# parse device_id
device_id=$(grep 'metadatas.deviceId' "$frpc_toml" | awk -F' = ' '{print $2}' | tr -d '"')
if [ -z "$device_id" ]; then
error " * Devide id is not assigned. Please run 'gaianet init' command first."

# stop the running services
stop_force
Expand All @@ -1204,7 +1203,7 @@ start() {

# start assistant
export RUST_LOG=info
nohup gaias --server-socket-addr 0.0.0.0:$llamaedge_port --server-log-file $gaianet_base_dir/log/start-llamaedge.log --server-health-url $server_health_url --server-info-url $server_info_url --system-prompt "$system_prompt" --rag-prompt "$rag_prompt" --log $gaianet_base_dir/log/assistant.log > /dev/null 2>&1 &
nohup gaias --server-socket-addr 0.0.0.0:$llamaedge_port --server-log-file $gaianet_base_dir/log/start-llamaedge.log --domain $domain --device-id $device_id --system-prompt "$system_prompt" --rag-prompt "$rag_prompt" --log $gaianet_base_dir/log/assistant.log > /dev/null 2>&1 &

sleep 2

Expand Down

0 comments on commit eeed0e7

Please sign in to comment.