guoqiang wang
commited on
Commit
•
2a5111e
1
Parent(s):
1635bab
Upload generate_block.sh
Browse files- generate_block.sh +32 -0
generate_block.sh
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
CHECKPOINT_PATH=/root/data/checkpoints
|
3 |
+
CHECKPOINT_PATH=../../../model_save/checkpoints/checkpoints
|
4 |
+
source $1
|
5 |
+
|
6 |
+
MPSIZE=1
|
7 |
+
MAXSEQLEN=512
|
8 |
+
MASTER_PORT=$(shuf -n 1 -i 10000-65535)
|
9 |
+
|
10 |
+
#SAMPLING ARGS
|
11 |
+
TEMP=0.9
|
12 |
+
#If TOPK/TOPP are 0 it defaults to greedy sampling, top-k will also override top-p
|
13 |
+
TOPK=40
|
14 |
+
TOPP=0
|
15 |
+
|
16 |
+
script_path=$(realpath $0)
|
17 |
+
script_dir=$(dirname $script_path)
|
18 |
+
|
19 |
+
config_json="$script_dir/ds_config.json"
|
20 |
+
|
21 |
+
#python -m torch.distributed.launch --nproc_per_node=$MPSIZE --master_port $MASTER_PORT generate_samples.py \
|
22 |
+
python3 generate_samples.py \
|
23 |
+
--DDP-impl none \
|
24 |
+
--model-parallel-size $MPSIZE \
|
25 |
+
$MODEL_ARGS \
|
26 |
+
--fp16 \
|
27 |
+
--cache-dir cache \
|
28 |
+
--out-seq-length $MAXSEQLEN \
|
29 |
+
--seq-length 512 \
|
30 |
+
--temperature $TEMP \
|
31 |
+
--top_k $TOPK \
|
32 |
+
--top_p $TOPP
|