Skip to content

Commit

Permalink
add hosted cpp support
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Jan 26, 2024
1 parent 5703368 commit 2422f42
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
17 changes: 15 additions & 2 deletions cpp-rllm/cpp-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ fi

VER="--no-default-features"

if [ "$1" = "--loop" ] ; then
LOOP=1
fi

if [ "$1" = "--cuda" ] ; then
VER="$VER --features cuda"
shift
Expand Down Expand Up @@ -82,5 +86,14 @@ export RUST_LOG=info,rllm=debug,aicirt=info

echo "running $BIN_SERVER $ARGS $@"

$BIN_SERVER $ARGS "$@"
exit $?
if [ "$LOOP" = "" ] ; then
$BIN_SERVER $ARGS "$@"
exit $?
fi

set +e
while : ; do
$BIN_SERVER --daemon $ARGS "$@" 2>&1 | rotatelogs -e -D ./logs/%Y-%m-%d-%H_%M_%S.txt 3600
echo "restarting..."
sleep 2
done
9 changes: 8 additions & 1 deletion scripts/host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FULL=0
STOP=0
START_CONTAINER=0
PULL=1
CPP=0

WS=`cd $(dirname $0)/..; pwd`

Expand Down Expand Up @@ -63,7 +64,13 @@ fi

if [ "$INNER" = "model" ] ; then
echo "in server for $MODEL in $FOLDER"
docker_cmd "cd $FOLDER && CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES /workspaces/aici/rllm/server.sh --loop $MODEL --port $FWD_PORT --shm-prefix /aici-${MODEL}-"
PREF="cd $FOLDER && CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES"
ARGS="--port $FWD_PORT --shm-prefix /aici-${MODEL}-"
if [ "$CPP" -eq 1 ] ; then
docker_cmd "$PREF /workspaces/aici/cpp-rllm/cpp-server.sh --loop --cuda $MODEL $ARGS"
else
docker_cmd "$PREF /workspaces/aici/rllm/server.sh --loop $MODEL $ARGS"
fi
exit 0
fi

Expand Down

0 comments on commit 2422f42

Please sign in to comment.