This repository was archived by the owner on Feb 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·109 lines (88 loc) · 2.78 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·109 lines (88 loc) · 2.78 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
# ensure that the scripts are executable
chmod +x ./graphdoc/run.sh
chmod +x ./graphdoc-server/run.sh
# setup commands
dev_install() {
echo "Installing all package dependencies..."
echo "Setting up graphdoc..."
cd graphdoc && ./run.sh dev
cd ..
echo "Setting up mlflow-manager..."
cd mlflow-manager && ./run.sh dev
cd ..
}
# make command
mlflow_setup() {
echo "Setting up mlflow-manager..."
cd mlflow-manager && ./run.sh install && ./run.sh make-install
cd ..
}
install() {
echo "Installing all package dependencies..."
echo "Setting up graphdoc..."
cd graphdoc && ./run.sh install
cd ..
echo "Setting up mlflow-manager..."
cd mlflow-manager && ./run.sh install
cd ..
}
mlflow_teardown() {
echo "Teardown mlflow-manager..."
cd mlflow-manager && ./run.sh make-clean
cd ..
}
# train commands
doc_quality_train() {
echo "Training a document quality model..."
cd graphdoc && ./run.sh dev && ./run.sh doc-quality-train
cd ..
}
doc_generator_train() {
echo "Training a document generator model..."
cd graphdoc && ./run.sh dev && ./run.sh doc-generator-train
cd ..
}
build_and_run_doc_quality_trainer() {
mlflow_setup
doc_quality_train
}
build_and_run_doc_generator_trainer() {
mlflow_setup
doc_generator_train
}
# help command
show_help() {
echo "Usage: ./nli [option]"
echo "Options:"
echo " dev Install all package dependencies in development mode"
echo " install Install all package dependencies in production mode"
# make commands
echo " mlflow-setup Install mlflow-manager dependencies and run the services"
echo " mlflow-teardown Teardown mlflow-manager services"
# train commands
echo " doc-quality-train Train a document quality model"
echo " doc-generator-train Train a document generator model"
# build and run commands
echo " build-and-run-doc-quality-train Build and run the document quality trainer"
echo " build-and-run-doc-generator-train Build and run the document generator trainer"
}
# run the script
if [ -z "$1" ]; then
show_help
else
case "$1" in
"dev") dev_install ;;
"install") install ;;
# make commands
"mlflow-setup") mlflow_setup ;;
"mlflow-teardown") mlflow_teardown ;;
# train commands
"doc-quality-train") doc_quality_train ;;
"doc-generator-train") doc_generator_train ;;
# build and run commands
"build-and-run-doc-quality-train") build_and_run_doc_quality_trainer ;;
"build-and-run-doc-generator-train") build_and_run_doc_generator_trainer ;;
*) show_help ;;
esac
fi