-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·57 lines (52 loc) · 1.28 KB
/
run.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
#!/bin/bash
# Initialize variables
LLM=""
UPDATE=()
MODEL_NAME=""
# Parse command line arguments
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
--llm)
LLM="--llm"
shift
;;
--update)
UPDATE+=("$2")
shift
shift
;;
--model-name)
MODEL_NAME="--model-name $2"
shift
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
# Construct --update arguments
UPDATE_ARGS=""
for file in "${UPDATE[@]}"; do
UPDATE_ARGS="$UPDATE_ARGS --update $file"
done
# Docker run command with parsed arguments
sudo docker run \
--name "checks-ocr" \
--rm \
-v .:/checks \
-v /checks-ocr/images:/checks-ocr/images \
-v /data/checks-ocr-vectordb:/checks-ocr/src/llm/vectordb \
-v /data/checks-ocr-llm-cache:/checks-ocr/src/llm/cache \
-v /data/checks-ocr-tecxtract-cache:/checks-ocr/cache \
-v /data/checks-ocr-data:/checks-ocr/data/data \
-e TEXTRACT_AWS_ACCESS_KEY_ID="$TEXTRACT_AWS_ACCESS_KEY_ID" \
-e TEXTRACT_AWS_REGION="$TEXTRACT_AWS_REGION" \
-e TEXTRACT_AWS_SECRET_ACCESS_KEY_ID="$TEXTRACT_AWS_SECRET_ACCESS_KEY_ID" \
-e OPENAI_API_KEY="$OPENAI_API_KEY" \
checks-ocr \
$LLM \
$UPDATE_ARGS \
$MODEL_NAME