-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_fast_inference.sh
61 lines (51 loc) · 2.06 KB
/
run_fast_inference.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
#!/bin/bash
# 가상환경 활성화
if command -v conda &> /dev/null
then
# conda 환경 활성화
source $(conda info --base)/etc/profile.d/conda.sh
conda activate korean_dialogue_summarization
elif command -v python3 &> /dev/null
then
# venv 환경 활성화
source korean_dialogue_summarization/bin/activate
else
echo "가상환경이 활성화되어 있지 않습니다. 가상환경을 먼저 활성화해 주세요."
exit 1
fi
# 결과를 저장할 폴더 생성 (없으면 생성)
RESULTS_DIR="results"
if [ ! -d "$RESULTS_DIR" ]; then
mkdir "$RESULTS_DIR"
fi
# checkpoint-115 모델로 test.py 실행
python -m run.test \
--output "$RESULTS_DIR/TG_SG_RR_result.json" \
--model_id "MLP-KTLim/llama-3-Korean-Bllossom-8B" \
--tokenizer "MLP-KTLim/llama-3-Korean-Bllossom-8B" \
--device "cuda:0" \
--adapter_checkpoint_path "checkpoints/checkpoint-115" \
--is_test "yes"
# TG_SG_RR_result.json에 대해 후처리
python -m postprocess \
--path "$RESULTS_DIR/TG_SG_RR_result.json" \
--output_path "$RESULTS_DIR/TG_SG_RR_result_postprocessed.json"
# checkpoint-150 모델로 test.py 실행
python -m run.test \
--output "$RESULTS_DIR/TG_SG_RR_Total_result.json" \
--model_id "MLP-KTLim/llama-3-Korean-Bllossom-8B" \
--tokenizer "MLP-KTLim/llama-3-Korean-Bllossom-8B" \
--device "cuda:0" \
--adapter_checkpoint_path "checkpoints/checkpoint-150" \
--is_test "yes"
# TG_SG_RR_Total_result.json에 대해 후처리
python -m postprocess \
--path "$RESULTS_DIR/TG_SG_RR_Total_result.json" \
--output_path "$RESULTS_DIR/TG_SG_RR_Total_result_postprocessed.json"
echo "Inference 작업이 완료되었습니다."
# 두 후처리 결과 파일을 앙상블
python -m postprocess \
--path "$RESULTS_DIR/TG_SG_RR_result_postprocessed.json" \
--ensemble_path_1 "$RESULTS_DIR/TG_SG_RR_Total_result_postprocessed.json" \
--output_path "$RESULTS_DIR/ensemble_1.json"
echo "후처리 및 앙상블 작업이 완료되었습니다. 결과 파일이 $RESULTS_DIR/ensemble_1.json으로 저장되었습니다."