Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
nlpworkers
wsd
Commits
e8d23f5f
Commit
e8d23f5f
authored
Dec 08, 2021
by
Grzegorz Kostkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change entrypoint to always download model
parent
c4e1c8c5
Pipeline
#4135
passed with stage
in 11 minutes and 36 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
entrypoint.sh
entrypoint.sh
+11
-8
No files found.
entrypoint.sh
View file @
e8d23f5f
#!/bin/sh
# Script downloads models defined in config file and starts worker.
# Script downloads models defined in config file and starts worker.
# Script should be called inside a container.
config_file
=
'/home/worker/config.ini'
# for now, name of file won't be changed so it's ok to use hardcoded value
model_filename
=
'merged_graph.xml.gz'
model_filename
=
'merged_graph.xml.gz'
# Simple function to retireve value for given key from ini file.
# Note that key should be unique, it does not handle sections
...
...
@@ -33,12 +33,15 @@ cd "$model_dir"
model_dir
=
$(
get_ini_value
"
$config_file
"
"model_dir"
)
model_url
=
$(
get_ini_value
"
$config_file
"
"model_url"
)
if
[
!
-f
"
$model_filename
"
]
;
then
echo
"Downloading a model '
$model_filename
' from '
$model_url
' ..."
remote_model_name
=
"
$model_filename
"
'.zip'
# assuming it is a zip archive
wget
-O
"
$remote_model_name
"
"
$model_url
"
unzip
"
$remote_model_name
"
;
rm
"
$remote_model_name
"
echo
"Done!"
if
[
-f
"
$model_filename
"
]
;
then
echo
"Removing old model ..."
rm
-f
"
$model_filename
"
fi
echo
"Downloading a model '
$model_filename
' from '
$model_url
' ..."
remote_model_name
=
"
$model_filename
"
'.zip'
# assuming it is a zip archive
wget
-O
"
$remote_model_name
"
"
$model_url
"
unzip
"
$remote_model_name
"
;
rm
"
$remote_model_name
"
echo
"Done!"
cd
/home/worker
&&
python3.6 main.py
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment