-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
74 lines (66 loc) · 1.58 KB
/
run.sh
File metadata and controls
74 lines (66 loc) · 1.58 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# Set default parameters
MODEL="gpt-4"
DATASET="Loong"
STRUCTURED=true
CHUNK=false
DOCUMENT=true
# Display help information
show_help() {
echo "Usage: $0 [options]"
echo "Options:"
echo " -m, --model MODEL Select model (default: gpt-4o)"
echo " -d, --dataset DATASET Select dataset (default: Loong)"
echo " -s, --structured Use structured processing (default: true)"
echo " -c, --chunk Use chunk processing (default: false)"
echo " -D, --document Use document processing (default: true)"
echo " -h, --help Show help information"
}
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
-m|--model)
MODEL="$2"
shift 2
;;
-d|--dataset)
DATASET="$2"
shift 2
;;
-s|--structured)
STRUCTURED=true
shift
;;
-c|--chunk)
CHUNK=true
shift
;;
-D|--document)
DOCUMENT=true
shift
;;
-h|--help)
show_help
exit 0
;;
*)
echo "Unknown option: $1"
show_help
exit 1
;;
esac
done
# Build command
CMD="python main.py --model $MODEL --dataset $DATASET"
if [ "$STRUCTURED" = true ]; then
CMD="$CMD --structured"
fi
if [ "$CHUNK" = true ]; then
CMD="$CMD --chunk"
fi
if [ "$DOCUMENT" = true ]; then
CMD="$CMD --document"
fi
# Execute command
echo "Executing command: $CMD"
eval $CMD