Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Sciencebeam Trainer Grobid
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sciencebeam
Sciencebeam Trainer Grobid
Commits
1c12c910
Unverified
Commit
1c12c910
authored
4 years ago
by
Daniel Ecer
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added multiple override models option (#53)
parent
0dc971fe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.env
+5
-0
5 additions, 0 deletions
.env
docker-compose.override.yml
+1
-1
1 addition, 1 deletion
docker-compose.override.yml
docker-compose.yml
+10
-1
10 additions, 1 deletion
docker-compose.yml
docker/entrypoint.sh
+14
-4
14 additions, 4 deletions
docker/entrypoint.sh
with
30 additions
and
6 deletions
.env
+
5
−
0
View file @
1c12c910
...
...
@@ -4,6 +4,11 @@ REVISION=develop
# $GROBID_TAG-$REVISION
IMAGE_TAG=0.5.6-develop
OVERRIDE_MODELS=
OVERRIDE_MODEL_1=
OVERRIDE_MODEL_2=
OVERRIDE_MODEL_3=
# all grobid tags built by ci
ALL_GROBID_TAGS=0.5.3,0.5.4,0.5.5,0.5.6
LATEST_GROBID_TAG=04346b26b5fa7966cef4d6ec6bba867feba52d66
This diff is collapsed.
Click to expand it.
docker-compose.override.yml
+
1
−
1
View file @
1c12c910
version
:
'
3'
version
:
'
3
.4
'
services
:
sciencebeam-trainer-grobid
:
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
10
−
1
View file @
1c12c910
version
:
'
3'
version
:
'
3.4'
x-grobid-env
:
&grobid-env
-
OVERRIDE_MODELS=${OVERRIDE_MODELS}
-
OVERRIDE_MODEL_1=${OVERRIDE_MODEL_1}
-
OVERRIDE_MODEL_2=${OVERRIDE_MODEL_2}
-
OVERRIDE_MODEL_3=${OVERRIDE_MODEL_3}
services
:
grobid-builder
:
...
...
@@ -21,6 +28,7 @@ services:
image
:
elifesciences/sciencebeam-trainer-grobid:${IMAGE_TAG}
depends_on
:
-
grobid-builder
environment
:
*grobid-env
volumes
:
-
data:/data
...
...
@@ -48,6 +56,7 @@ services:
image
:
elifesciences/sciencebeam-trainer-grobid-dev:${IMAGE_TAG}
depends_on
:
-
sciencebeam-trainer-grobid-dev-base
environment
:
*grobid-env
volumes
:
-
data:/data
...
...
This diff is collapsed.
Click to expand it.
docker/entrypoint.sh
+
14
−
4
View file @
1c12c910
...
...
@@ -4,16 +4,26 @@ set -e
GROBID_MODELS_DIRECTORY
=
${
GROBID_MODELS_DIRECTORY
:-
/opt/grobid-source/grobid-home/models
}
if
[
!
-z
"
${
OVERRIDE_MODELS
}
"
]
;
then
# override models via OVERRIDE_MODELS or OVERRIDE_MODELS_*
# the latter makes it easier to override multiple models as separate env variables
env
-0
|
while
IFS
=
'='
read
-r
-d
''
env_var_name env_var_value
;
do
if
[[
-z
"
${
env_var_value
}
"
]]
;
then
# skip empty values
continue
fi
if
[[
"
${
env_var_name
}
"
!=
"OVERRIDE_MODELS"
]]
&&
[[
"
${
env_var_name
}
"
!=
OVERRIDE_MODEL_
*
]]
;
then
# skipping other env variable names
continue
fi
if
[
!
-d
"
${
GROBID_MODELS_DIRECTORY
}
"
]
;
then
echo
"directory does not exist:
${
GROBID_MODELS_DIRECTORY
}
"
exit
1
fi
echo
"installing models:
${
OVERRIDE_MODELS
}
"
echo
"installing models:
${
env_var_value
}
(
${
env_var_name
}
)
"
python
-m
sciencebeam_trainer_grobid.tools.install_models
\
--model-base-path
=
${
GROBID_MODELS_DIRECTORY
}
\
--install
"
${
OVERRIDE_MODELS
}
"
\
--install
"
${
env_var_value
}
"
\
--validate-pickles
fi
done
exec
"
$@
"
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment