start_multi_servers.sh 1.1 KB
Newer Older
Zhuguanyu Wu's avatar
Zhuguanyu Wu committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# Default values
lightx2v_path=
model_path=

# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
    cuda_devices=0,1,2,3,4,5,6,7
    echo "Warn: CUDA_VISIBLE_DEVICES is not set, using default value: ${cuda_devices}, change at shell script or set env variable."
    export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi

if [ -z "${num_gpus}" ]; then
    num_gpus=8
fi

# Check required parameters
19
20
if [ -z "${lightx2v_path}" ]; then
    echo "Error: lightx2v_path is not set. Please set this variable first."
Zhuguanyu Wu's avatar
Zhuguanyu Wu committed
21
22
23
    exit 1
fi

24
25
if [ -z "${model_path}" ]; then
    echo "Error: model_path is not set. Please set this variable first."
Zhuguanyu Wu's avatar
Zhuguanyu Wu committed
26
27
28
29
30
31
32
33
    exit 1
fi

# Set environment variables
export TOKENIZERS_PARALLELISM=false
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
export ENABLE_PROFILING_DEBUG=true
export ENABLE_GRAPH_MODE=false
gushiqiao's avatar
gushiqiao committed
34
export DTYPE=BF16
Zhuguanyu Wu's avatar
Zhuguanyu Wu committed
35
36
37
38
39

# Start multiple servers
python -m lightx2v.api_multi_servers \
    --num_gpus $num_gpus \
    --start_port 8000 \
40
41
    --model_cls wan2.1_distill \
    --task i2v \
Zhuguanyu Wu's avatar
Zhuguanyu Wu committed
42
    --model_path $model_path \
43
    --config_json ${lightx2v_path}/configs/distill/wan_i2v_distill_4step_cfg.json