-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_lctg.sh
60 lines (47 loc) · 1.42 KB
/
run_lctg.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
if [ -f .env ]
then
# Source the .env file
source .env
else
echo ".env file not found"
exit 1
fi
cd scripts
if [ -z "$VERSION" ]
then
echo "ERROR: The VERSION environment variable is not set."
exit 1
fi
if [ -z "$OPENAI_API_KEY" ]
then
echo "ERROR: The OPENAI_API_KEY environment variable is not set."
exit 1
fi
if [ -z "$MODEL_PATH_0" ]
then
echo "ERROR: The MODEL_PATH_0 environment variable is not set."
exit 1
fi
# 実行したいpythonファイルのパスをそれぞれ定義します
INFERENCE_SCRIPT="generator.py"
FORMATTING_SCRIPT="header_footer_remover.py"
CTG_SCORE_SCRIPT="eval_ctg.py"
QUALITY_SCORE_SCRIPT="eval_quality.py"
ALL_SCORE_SCRIPT="get_scores.py"
TASKS=("summary" "ad_text" "pros_and_cons")
for TASK in ${TASKS[@]}; do
echo "Running scripts for task: $TASK..."
# 推論を実施するpythonファイルを実行します
echo "Running inference script..."
python $INFERENCE_SCRIPT --task $TASK
# 推論結果を整形するpythonファイルを実行します
echo "Running formatting script..."
python $FORMATTING_SCRIPT --task $TASK
# 整形した推論結果からスコアを獲得するpythonファイルを実行します
echo "Running score script...(CTG)"
python $CTG_SCORE_SCRIPT --task $TASK
echo "Running score script...(Quality)"
python $QUALITY_SCORE_SCRIPT --task $TASK
done
python get_scores.py
echo "All scripts executed successfully."