forked from RManLuo/ChatRule
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_chatrule.sh
executable file
·67 lines (51 loc) · 1.91 KB
/
run_chatrule.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
DATA="family" # umls wn-18rr yago
SUMMARY_MODEL="none"
RANK_MODE="all"
FEW_SHOT=50
REPEAT=15
MEM="50G"
# PREFIX=""
MODEL_NAME="gpt-3.5-turbo"
N_PROCESS=10
# MODEL_NAME="gpt-4"
# N_PROCESS=10
# MODEL_NAME="Qwen-7B-Chat"
# MODEL_PATH="Qwen/Qwen-7B-Chat"
# N_PROCESS=1
# QUANT=none
# MODEL_NAME="Qwen-14B-Chat"
# MODEL_PATH="Qwen/Qwen-14B-Chat"
# N_PROCESS=1
# QUANT=none
# MODEL_NAME="Mistral-7B-Instruct-v0.1"
# MODEL_PATH="mistralai/Mistral-7B-Instruct-v0.1"
# N_PROCESS=1
# QUANT=none
# MODEL_NAME="llama2-7B-chat-hf"
# MODEL_PATH="meta-llama/Llama-2-7b-chat-hf"
# N_PROCESS=1
# QUANT=none
# MODEL_NAME="llama2-13B-chat-hf"
# MODEL_PATH="meta-llama/Llama-2-13b-chat-hf"
# N_PROCESS=1
# QUANT=none
# MODEL_NAME="vicuna-33b-v1.3"
# MODEL_PATH="lmsys/vicuna-33b-v1.3"
# N_PROCESS=1
# QUANT=none
# MODEL_NAME="llama2-70B-chat-hf"
# MODEL_PATH="meta-llama/Llama-2-70b-chat-hf"
# N_PROCESS=1
# QUANT=none
MODEL_PREFIX=${MODEL_NAME}-top-0-f-${FEW_SHOT}-l-${REPEAT}
if [[ $MODEL_NAME == *"gpt"* ]]; then
python chat_rule_generator.py --dataset $DATA --model_name $MODEL_NAME -f $FEW_SHOT -l $REPEAT -n $N_PROCESS && \
python clean_rule.py --dataset $DATA --model $SUMMARY_MODEL -p $MODEL_PREFIX && \
python rank_rule.py --dataset $DATA -p clean_rules/${DATA}/${MODEL_PREFIX}/${SUMMARY_MODEL} --eval_mode ${RANK_MODE} && \
python kg_completion.py --dataset $DATA -p ranked_rules/${DATA}/${MODEL_PREFIX}/${SUMMARY_MODEL}/${RANK_MODE}
else
python chat_rule_generator.py --dataset $DATA --model_name $MODEL_NAME --model_path ${MODEL_PATH} -f $FEW_SHOT -l $REPEAT -n $N_PROCESS --quant $QUANT && \
python clean_rule.py --dataset $DATA --model $SUMMARY_MODEL -p $MODEL_PREFIX && \
python rank_rule.py --dataset $DATA -p clean_rules/${DATA}/${MODEL_PREFIX}/${SUMMARY_MODEL} --eval_mode ${RANK_MODE} && \
python kg_completion.py --dataset $DATA -p ranked_rules/${DATA}/${MODEL_PREFIX}/${SUMMARY_MODEL}/${RANK_MODE}
fi