File “/Users/foobar/src/DeepPavlov/deeppavlov/utils/server/init.py”, line 1, in
from .server import get_server_params, get_ssl_params, redirect_root_to_docs, start_model_server
File “/Users/foobar/src/DeepPavlov/deeppavlov/utils/server/server.py”, line 26, in
from pydantic.fields import Field, ModelField
ImportError: cannot import name ‘ModelField’ from ‘pydantic.fields’ (/Users/foobar/src//DeepPavlov/env/lib/python3.7/site-packages/pydantic/fields.py)
Any idea what I might be doing wrong?
I am not a python programmer, so any help is very much appreciated
File “/Users/foobar/src//DeepPavlov/env/lib/python3.7/site-packages/uvicorn/main.py”, line 262, in run
config = Config(app, **kwargs)
TypeError: init() got an unexpected keyword argument ‘log_config’
Running pip install -e . from the repository root should fix this.
When you’re doing pip install deeppavlov, you’re installing the latest master version with its requirements but in dev branch some of them were updated.
what is the recommended command line sequence to develop and test my local changes?
If you’ve installed deeppavlov with -e from a local directory python will look for the library code in that directory, so you can change your code and see the changes.
I would advise you to fork the repository first and work with you own version of it so that you could push your changes to github and mayber send us a pull request with your changes later.
I see two endpoints
All the endpoinds are there:
/docs endpoint is where you see /model and /api documentation
/probe is there but not documented in /docs, you can send a POST request on /probe using other tools, such as curl, requests python library, or Postman.
I have created a fork and a branch where I have started the implementation of a REST interface to retrain the model. It is working, but the implementation could be improved and maybe you could have a quick look at it and check whether the general implementation makes sense.
In particular I am not quite sure what is best to reload/rebuild the model
There is no need to use the argparser module, I feel.
To rewrite the model variable only once inside a nested function you can use the nonlocal keyword.