YFanwang commited on
Commit
cbd06e4
·
verified ·
1 Parent(s): 6e909fa

Upload VideoX-Fun/gen_ref_videos.sh

Browse files
Files changed (1) hide show
  1. VideoX-Fun/gen_ref_videos.sh +53 -0
VideoX-Fun/gen_ref_videos.sh ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ echo "正在启动 8 个并行的独立任务,并为每个任务分配不同参数..."
4
+
5
+ # 1. 在这里预先定义你的参数数组 (a_i)
6
+ # 数组元素的数量应该与你的任务数量(8)相匹配。
7
+ # 参数可以是任何字符串,比如文件名、配置名、数值等。
8
+ save_folder='data/ref_videos'
9
+ sampler_name='Flow'
10
+ prompt_list_path='/nfs/ywang29/Reward_finetuning/VideoX-Fun/VBench/prompts/all_dimension.txt'
11
+ num_inference_steps=50
12
+ # enable_teacache=False
13
+ # params=(
14
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_4/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"
15
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_7/checkpoint-1000/transformer/diffusion_pytorch_model.safetensors"
16
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_5/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"
17
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_6/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"
18
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_6/checkpoint-1000/transformer/diffusion_pytorch_model.safetensors"
19
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_6/checkpoint-2000/transformer/diffusion_pytorch_model.safetensors"
20
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_7/checkpoint-500/transformer/diffusion_pytorch_model.safetensors"
21
+ # "--transformer_path /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_full/output_Oct14_7/checkpoint-2000/transformer/diffusion_pytorch_model.safetensors"
22
+ # )
23
+ params=(
24
+ "--prompt_list_path ref_video_prompt_list_part_0.txt"
25
+ "--prompt_list_path ref_video_prompt_list_part_1.txt"
26
+ "--prompt_list_path ref_video_prompt_list_part_2.txt"
27
+ "--prompt_list_path ref_video_prompt_list_part_3.txt"
28
+ "--prompt_list_path ref_video_prompt_list_part_4.txt"
29
+ "--prompt_list_path ref_video_prompt_list_part_5.txt"
30
+ "--prompt_list_path ref_video_prompt_list_part_6.txt"
31
+ "--prompt_list_path ref_video_prompt_list_part_7.txt"
32
+ )
33
+
34
+
35
+
36
+ # 2. 修改循环以遍历数组的索引
37
+ # ${!params[@]} 会获取数组 params 的所有索引 (0 1 2 3 4 5 6 7)
38
+ for i in "${!params[@]}"
39
+ do
40
+ # 从数组中获取当前索引对应的参数值
41
+ current_param="${params[$i]}"
42
+
43
+ # CUDA_VISIBLE_DEVICES=$i 告诉程序只能“看见”并使用第 i 张 GPU
44
+ # python X.py --p "$current_param" 将当前参数传递给脚本
45
+ # & 让命令在后台运行
46
+ echo "启动任务 $i (GPU $i),参数为: $current_param"
47
+ CUDA_VISIBLE_DEVICES=$i python ./examples/wan2.1/predict_t2v_14B_vqref.py --prompt_list_path $prompt_list_path --num_inference_steps $num_inference_steps --save_folder $save_folder --sampler_name $sampler_name $current_param &
48
+ done
49
+
50
+ # 'wait' 命令会等待所有后台任务都执行完毕
51
+ echo "所有任务已启动。等待它们全部完成..."
52
+ wait
53
+ echo "所有任务已完成。"