-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_large.sh
46 lines (36 loc) · 922 Bytes
/
generate_large.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Determine how many texts to generate for each topic
N=3
PROMPT="prompt/fewshot/v1"
DIR="output/large-fewshot/test"
mkdir -p $DIR
DEXPERTS="models/DExperts-large/finetuned_gpt2_nontoxic"
DEXPERTS_ANTI="heegyu/DExperts-large/finetuned_gpt2_toxic"
GATE="no"
OMEGA=30
ALPHA=1.0
RANKING_SCOPE=10
run() {
TYPE=$1
if [ $GATE = "no" ]
then
OUTPUT="$DIR/$TYPE.jsonl"
else
OUTPUT="$DIR/$TYPE-gate-t005.jsonl"
fi
python run_fewshot.py --model "gpt2-large" --model-type "$TYPE" \
--n $N \
--toxic-model $DEXPERTS \
--nontoxic-model $DEXPERTS_ANTI \
--gate-model $GATE \
--disc_weight $OMEGA \
--alpha $ALPHA \
--ranking_scope $RANKING_SCOPE \
--gate-threshold 0.005 \
--prompt-dir $PROMPT \
$OUTPUT
}
run "gpt2"
# use gated detoxifier,
GATE="s-nlp/roberta_toxicity_classifier"
run "gedi"
run "discup"