-
Notifications
You must be signed in to change notification settings - Fork 15
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
Start the server with default languages. #57
Comments
I have managed to load a language on the startup on the application
In order to load a default language, we need a way to load the model info into the db (if not already there) then we can call the /update endpoint, but most of the methods I've been trying run into problems. |
Thoughts @Kabongosalomon ? |
Hey @vukosim @Kabongosalomon, just some more info on this issue before it is (hopefully) closed. Summary:
To add a default model, we just need to load the model info into database, from there a get req to /update will download the model. The initial idea is to add the default model into the db from the src/core init.py which was attempted in PR #63, which I think can be closed without merging due to the problems encountered:
In the docker entrypoint.sh there is a script that waits for the database to start, then it executes the command This was the reasoning to add a A good next issue might be invoking the update command from the python manage.py instead of through the api, then the model can be downloaded independent of a get req to the client. |
Hi @lastrucci01 thanks for the excellent description of the current solution. Ideally, I would like us to get rid of the need to hit the update endpoint to have the model available in memory, the current solution works just fine but only loads the model in the database. The other related issue (maybe we need to create a separate issue for this) is the behaviors of the update endpoints when the db has more than 5 languages, the hit timeout and no model are loaded. |
Hello @Kabongosalomon, thanks for the response I was trying to create an Problem: So then the api resources are constructed with an empty saved_models assigned to a local variable, the requests made to that resource update the local variable - for example in the AddResouce( So I think the confusion arises in A solution might be to have a global saved_models object that |
The service starts with no language in memory, and we need to run
curl --request GET 'http://127.0.0.1:5000/update
to load the language pairs available in the databasepython manage.py all_languages
in memory.Edit the class AddResource to have default mode loaded when the command
docker-compose up -d
The text was updated successfully, but these errors were encountered: