-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support loading models eagerly #762
Comments
Hi @elonzh, you can change the load strategy from the configuration file. See here: https://grobid.readthedocs.io/en/latest/Grobid-service/#model-loading-strategy |
Yes, I found it in #443 (comment). |
@lfoppiano Can we config the service by environment variables just like |
Yes, you can but you need to modify the config file as follow: modelPreload: ${MODEL_PRELOAD:- false} and then export MODEL_PRELOAD=true See an example: https://github.com/lfoppiano/grobid-superconductors/blob/4bc75e47d42d43159a32b5c380a2ce16b94a1125/resources/config/config.yml#L7 |
Seems not working.
|
Could you share your config file? |
just one line change
|
Can you try to use the quotes? |
|
OK I need to do some more tests on it |
Nice work! Although I think giving some tests is a better way to test this feature. I already use the config file to preload models so the issue is not a big deal for me. |
Hi @lfoppiano! I was facing the same issue (wanted to load models eagerly) because of the slow start and found this issue thread. I'm a bit confused as to how I can set model_preload=true if I'm using the docker image to run the grobid server. Is there a way I can include an argument (like an environment parameter) in the "docker run..." command? Or should I try to edit the docker container and change the default parameter in the config file to true? Thanks in advance! |
You should mount the config file to the right path. A docker-compose.yml example:
|
@ishaqibrahimbot also have a look at the grobid documentation related to Docker:
|
@lfoppiano @kermitt2 Really appreciate how quickly you guys responded, and apologies for getting back to you after such a delay! Just wanted to share an update: after reading through your suggestions and the Grobid docs a few times, I was successfully able to mount the modified config.yaml to the docker image and get the models to preload. Thank you for the help! |
Closing this issue because all the points have been covered and are documented. Don't hesitate to re-open it if you need more related actions. |
Currently, the grobid service will load models when the first request coming in. This behavior causes some usability issues because the first request is always slow and the API/task which depends on grobid may timeout.
I don't know why we need this lazy loading mechanism and I think we should support loading models eagerly.
The text was updated successfully, but these errors were encountered: