Commit a843121d authored by zhiwei.dong's avatar zhiwei.dong Committed by Yang Yong(雍洋)
Browse files

[format]: remove hard-coded path variable,refine shell

parent b878b073
#!/bin/bash
export PYTHONPATH="./":$PYTHONPATH
# onnx_path=""
# trtexec \
# --onnx="/mnt/nvme0/wq/project/sd/code/lightx2v/vae_decoder_hf_sim.onnx" \
# --onnx=${onnx_path} \
# --saveEngine="./vae_decoder_hf_sim.engine" \
# --allowWeightStreaming \
# --stronglyTyped \
......@@ -11,4 +12,5 @@ export PYTHONPATH="./":$PYTHONPATH
# --optShapes=inp:1x16x17x32x16 \
# --maxShapes=inp:1x16x17x32x32
python examples/vae_trt/convert_vae_trt_engine.py --model_path "/mnt/nvme1/yongyang/models/hy/ckpts"
model_path=""
python examples/vae_trt/convert_vae_trt_engine.py --model_path ${model_path}
export PYTHONPATH=/home/devsft/huangxinchi/lightx2v:$PYTHONPATH
lightx2v_path=""
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
python3 test.py
......@@ -50,7 +50,8 @@ class TextEncoderHFClipModel:
if __name__ == "__main__":
model = TextEncoderHFClipModel("/mnt/nvme0/yongyang/projects/hy/HunyuanVideo/ckpts/text_encoder_2", torch.device("cuda"))
model_path = ""
model = TextEncoderHFClipModel(model_path, torch.device("cuda"))
text = "A cat walks on the grass, realistic style."
outputs = model.infer(text)
print(outputs)
......@@ -63,7 +63,8 @@ class TextEncoderHFLlamaModel:
if __name__ == "__main__":
model = TextEncoderHFLlamaModel("/mnt/nvme0/yongyang/projects/hy/HunyuanVideo/ckpts/text_encoder", torch.device("cuda"))
model_path = ""
model = TextEncoderHFLlamaModel(model_path, torch.device("cuda"))
text = "A cat walks on the grass, realistic style."
outputs = model.infer(text)
print(outputs)
......@@ -509,7 +509,7 @@ class T5EncoderModel:
if __name__ == "__main__":
checkpoint_dir = "/mnt/nvme0/yongyang/projects/wan/Wan2.1-T2V-1.3B"
checkpoint_dir = ""
t5_checkpoint = "models_t5_umt5-xxl-enc-bf16.pth"
t5_tokenizer = "google/umt5-xxl"
model = T5EncoderModel(
......
......@@ -41,4 +41,5 @@ class VideoEncoderKLCausal3DModel:
if __name__ == "__main__":
vae_model = VideoEncoderKLCausal3DModel("/mnt/nvme0/yongyang/projects/hy/new/HunyuanVideo/ckpts", dtype=torch.float16, device=torch.device("cuda"))
model_path = ""
vae_model = VideoEncoderKLCausal3DModel(model_path, dtype=torch.float16, device=torch.device("cuda"))
......@@ -35,4 +35,5 @@ class VideoEncoderKLCausal3DModel:
if __name__ == "__main__":
vae_model = VideoEncoderKLCausal3DModel("/mnt/nvme1/yongyang/models/hy/ckpts", dtype=torch.float16, device=torch.device("cuda"))
model_path = ""
vae_model = VideoEncoderKLCausal3DModel(model_path, dtype=torch.float16, device=torch.device("cuda"))
#!/bin/bash
lightx2v_path=/mtc/yongyang/projects/lightx2v
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
# set path and first
lightx2v_path=""
model_path=""
# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices="0"
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
export CUDA_VISIBLE_DEVICES=2
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
model_path=/mtc/yongyang/models/x2v_models/hunyuan/lightx2v_format/t2v
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
python ${lightx2v_path}/lightx2v/__main__.py \
--model_cls hunyuan \
......
#!/bin/bash
lightx2v_path=/home/devsft/huangxinchi/lightx2v
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
# set path and first
lightx2v_path=""
model_path=""
# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0,1,2,3, change at shell script or set env variable."
cuda_devices="0,1,2,3"
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
export CUDA_VISIBLE_DEVICES=4,5,6,7
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
model_path=/mtc/yongyang/models/x2v_models/hunyuan/lightx2v_format/t2v
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
torchrun --nproc_per_node=4 ${lightx2v_path}/lightx2v/__main__.py \
......
#!/bin/bash
lightx2v_path=/mtc/yongyang/projects/lightx2v
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
# set path and first
lightx2v_path=""
model_path=""
# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices="0"
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
export CUDA_VISIBLE_DEVICES=2
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
model_path=/mtc/yongyang/models/x2v_models/hunyuan/lightx2v_format/t2v
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
python ${lightx2v_path}/lightx2v/__main__.py \
......
#!/bin/bash
lightx2v_path=/mtc/yongyang/projects/lightx2v
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
# set path and first
lightx2v_path=""
model_path=""
config_path=""
# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices="0"
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
export CUDA_VISIBLE_DEVICES=2
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
model_path=/mtc/yongyang/models/x2v_models/wan/Wan2.1-I2V-14B-480P
config_path=/mtc/yongyang/models/x2v_models/wan/Wan2.1-I2V-14B-480P/config.json
if [ -z "${config_path}" ]; then
echo "Error: config_path is not set. Please set this variable first."
exit 1
fi
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
python ${lightx2v_path}/lightx2v/__main__.py \
......
#!/bin/bash
lightx2v_path=/mtc/yongyang/projects/lightx2v
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
# set path and first
lightx2v_path=""
model_path=""
config_path=""
# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0, change at shell script or set env variable."
cuda_devices="0"
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
export CUDA_VISIBLE_DEVICES=2
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
model_path=/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B
config_path=/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B/config.json
if [ -z "${config_path}" ]; then
echo "Error: config_path is not set. Please set this variable first."
exit 1
fi
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
python ${lightx2v_path}/lightx2v/__main__.py \
......
#!/bin/bash
lightx2v_path=/home/devsft/huangxinchi/lightx2v
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
# set path and first
lightx2v_path=""
model_path=""
config_path=""
# check section
if [ -z "${CUDA_VISIBLE_DEVICES}" ]; then
echo "Warn: CUDA_VISIBLE_DEVICES is not set, using defalt value: 0,1,2,3 , change at shell script or set env variable."
cuda_devices="0,1,2,3"
export CUDA_VISIBLE_DEVICES=${cuda_devices}
fi
if [ -z "${lightx2v_path}" ]; then
echo "Error: lightx2v_path is not set. Please set this variable first."
exit 1
fi
export CUDA_VISIBLE_DEVICES=4,5,6,7
if [ -z "${model_path}" ]; then
echo "Error: model_path is not set. Please set this variable first."
exit 1
fi
model_path=/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B
config_path=/mtc/yongyang/models/x2v_models/wan/Wan2.1-T2V-1.3B/config.json
if [ -z "${config_path}" ]; then
echo "Error: config_path is not set. Please set this variable first."
exit 1
fi
export PYTHONPATH=${lightx2v_path}:$PYTHONPATH
torchrun --nproc_per_node=4 ${lightx2v_path}/lightx2v/__main__.py \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment