From 1dfea2e2a4a2f4bfd869b8165bcdde6540fd8402 Mon Sep 17 00:00:00 2001 From: kcz358 Date: Tue, 27 Aug 2024 05:31:12 +0000 Subject: [PATCH] Update srt commands --- docs/commands.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index 3566e0f6..8a15b09c 100755 --- a/docs/commands.md +++ b/docs/commands.md @@ -27,20 +27,38 @@ This mode supports a number of command-line arguments, the details of which can > install sglang ```bash -git clone /~https://github.com/EvolvingLMMs-Lab/sglang.git +git clone /~https://github.com/sgl-project/sglang.git +# Current version is tested on #1222 cd sglang; -git checkout dev/onevision_local; pip install -e "python[srt]" + +# Install FlashInfer CUDA kernels +pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.4/ ``` > run sglang backend service with the following command ```bash -# backend service -python -m sglang.launch_server --model-path "\path\to\onevision" --tokenizer-path lmms-lab/llavanext-qwen-siglip-tokenizer --port=30000 --host=127.0.0.1 --tp-size=8 --chat-template=chatml-llava +# After update, there is no need to use an extra command to setup backend server +# the server will be initialized in the init process # launch lmms-eval srt_api model -python -m accelerate.commands.launch --main_process_port=12580 --num_processes=1 lmms_eval --model=srt_api --model_args=modality=image,host=127.0.0.1,port=30000 --tasks=ai2d --batch_size=1 --log_samples --log_samples_suffix=debug --output_path=./logs/ --verbosity=DEBUG +CKPT_PATH=$1 +TASK=$2 +MODALITY=$3 +TP_SIZE=$4 +echo $TASK +TASK_SUFFIX="${TASK//,/_}" +echo $TASK_SUFFIX + +python3 -m lmms_eval \ + --model srt_api \ + --model_args modality=$MODALITY,model_version=$CKPT_PATH,tp=$TP_SIZE,host=127.0.0.1,port=30000,timeout=600 \ + --tasks $TASK \ + --batch_size 1 \ + --log_samples \ + --log_samples_suffix $TASK_SUFFIX \ + --output_path ./logs/ ``` You may need to install some dependencies for the above command to work (if you encounter some errors). @@ -48,7 +66,6 @@ You may need to install some dependencies for the above command to work (if you ```bash pip install httpx==0.23.3 pip install protobuf==3.20 -pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3/ ```