-
Notifications
You must be signed in to change notification settings - Fork 11
/
entrypoint.sh
executable file
·57 lines (51 loc) · 1.5 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
#!/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 nl, space fr} - Download packages for mitie or spacy (english or french or dutch)"
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..."
python -m rasa_nlu.download -p mitie
;;
spacy)
case $2 in
en|nl|fr)
echo "Downloading spacy.$2 model..."
python -m spacy download "$2"
echo "Done."
;;
*)
echo "Error. Rasa_nlu supports only english, dutch and french 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