generate_text.sh 756 Bytes
Newer Older
1
2
#!/bin/bash

3
CHECKPOINT_PATH=checkpoints/gpt2_345m/
4
MPSIZE=1
5
6
7
NLAYERS=12
NHIDDEN=768
NATT=12
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
MAXSEQLEN=1024

#SAMPLING ARGS
TEMP=0.9
#If TOPK/TOPP are 0 it defaults to greedy sampling, top-k will also override top-p
TOPK=0
TOPP=0

python generate_samples.py \
       --model-parallel-size $MPSIZE \
       --num-layers $NLAYERS \
       --hidden-size $NHIDDEN \
       --load $CHECKPOINT_PATH \
       --num-attention-heads $NATT \
       --max-position-embeddings 1024 \
       --tokenizer-type GPT2BPETokenizer \
       --fp16 \
       --cache-dir cache \
       --out-seq-length $MAXSEQLEN \
       --temperature $TEMP \
       --top_k $TOPK \
29
30
31
32
       --genfile dbg_unconditional.json \
       --num-samples 10 \
       --top_p $TOPP \
       --recompute