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

Mohammad's avatar
Mohammad committed
3
4
5
CHECKPOINT_PATH=checkpoints/gpt2_345m
VOCAB_FILE=gpt2-vocab.json
MERGE_FILE=gpt2-merges.txt
6

Mohammad's avatar
Mohammad committed
7
python tools/generate_samples_gpt2.py \
8
       --intra-layer-model-parallel-size 1 \
Mohammad's avatar
Mohammad committed
9
10
       --num-layers 24 \
       --hidden-size 1024 \
11
       --load $CHECKPOINT_PATH \
Mohammad's avatar
Mohammad committed
12
       --num-attention-heads 16 \
13
14
15
       --max-position-embeddings 1024 \
       --tokenizer-type GPT2BPETokenizer \
       --fp16 \
Mohammad's avatar
Mohammad committed
16
17
18
19
20
21
22
23
24
       --batch-size 2 \
       --seq-length 1024 \
       --out-seq-length 1024 \
       --temperature 1.0 \
       --vocab-file $VOCAB_FILE \
       --merge-file $MERGE_FILE \
       --genfile unconditional_samples.json \
       --num-samples 2 \
       --top_p 0.9 \
25
       --recompute