-
-
Notifications
You must be signed in to change notification settings - Fork 421
/
entrypoint.sh
executable file
·58 lines (52 loc) · 1.56 KB
/
entrypoint.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
#!/bin/bash
set -e
function print_help {
echo "Available options:"
echo " start commands (rasa cmd line arguments) - Start RasaNLU server"
echo " download {mitie, spacy en, spacy de} - Download packages for mitie or spacy (english or german)"
echo " start -h - Print RasaNLU help"
echo " help - Print this help"
echo " run - Run an arbitrary command inside the container"
}
function download_package {
case $1 in
mitie)
echo "Downloading mitie model..."
wget https://github.com/mit-nlp/MITIE/releases/download/v0.4/MITIE-models-v0.2.tar.bz2
tar jxf MITIE-models-v0.2.tar.bz2
;;
spacy)
case $2 in
en|de)
echo "Downloading spacy.$2 model..."
python -m spacy download "$2"
echo "Done."
;;
*)
echo "Error. Rasa_nlu supports only english and german models for the time being"
print_help
exit 1
;;
esac
;;
*)
echo "Error: invalid package specified."
echo
print_help
;;
esac
}
case ${1} in
start)
exec python -m rasa_nlu.server "${@:2}"
;;
run)
exec "${@:2}"
;;
download)
download_package ${@:2}
;;
*)
print_help
;;
esac