Skip to content

Commit

Permalink
Update srt commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kcz358 committed Aug 27, 2024
1 parent 0d02bad commit 1dfea2e
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,45 @@ 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).

```bash
pip install httpx==0.23.3
pip install protobuf==3.20
pip install flashinfer -i https://flashinfer.ai/whl/cu121/torch2.3/
```


0 comments on commit 1dfea2e

Please sign in to comment.