forked from LAIR-RCC/ruadapt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprocess_loras.sh
More file actions
executable file
·48 lines (43 loc) · 1.4 KB
/
process_loras.sh
File metadata and controls
executable file
·48 lines (43 loc) · 1.4 KB
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
#!/bin/bash
# Проверяем, что передан список директорий
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <directory> [<directory> ...]"
exit 1
fi
fold=$2
# Проходимся по всем переданным директориям
asl=()
asl+=(0.5)
asl+=(0.66)
asl+=(0.8)
asl+=(1.0)
asl+=(1.25)
asl+=(1.5)
asl+=(1.75)
asl+=(2.0)
for dir in "$@"; do
# Проверяем, существует ли директория
if [ ! -d "$dir" ]; then
echo "Directory $dir does not exist."
continue
fi
# Проходимся по всем checkpoint-X директориям
#for checkpoint in "$dir"/; do
for asl_value in "${asl[@]}"; do
checkpoint="$dir/$asl_value"
if [ -d "$checkpoint" ]; then
eval_dir="$checkpoint/$fold"
#echo $eval_dir
results_file="$eval_dir/evaluation_results.txt"
# Проверяем наличие файла evaluation_results.txt
if [ -f "$results_file" ]; then
# Выводим имя директории и вторую строку из файла
second_line=$(sed -n '2p' "$results_file")
echo "$asl_value ${second_line//./,}"
else
continue
#echo "evaluation_results.txt not found in $eval_dir."
fi
fi
done
done