Bug description:
For the built-in image_manual
interface, when the config value "image_manual_modes"
is set either with prodigy.json
or in a custom recipe, the following error occurs:
> prodigy image.manual test_dataset ./dataset/dataset.jsonl --loader jsonl --label PERSON
Using 1 label(s): PERSON
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/adambozson/Library/Caches/pypoetry/virtualenvs/bl-ocr-WI3q7U0s-py3.11/lib/python3.11/site-packages/prodigy/__main__.py", line 63, in <module>
controller = recipe(*args, use_plac=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "cython_src/prodigy/core.pyx", line 868, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File "cython_src/prodigy/core.pyx", line 153, in prodigy.core.Controller.from_components
File "cython_src/prodigy/core.pyx", line 295, in prodigy.core.Controller.__init__
File "/Users/adambozson/Library/Caches/pypoetry/virtualenvs/bl-ocr-WI3q7U0s-py3.11/lib/python3.11/site-packages/prodigy/components/validate.py", line 89, in validate_config
validate(Config, config, error_msg=error_msg, print_obj=False)
File "/Users/adambozson/Library/Caches/pypoetry/virtualenvs/bl-ocr-WI3q7U0s-py3.11/lib/python3.11/site-packages/prodigy/components/validate.py", line 147, in validate
Schema(**obj)
File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
File "pydantic/main.py", line 1076, in pydantic.main.validate_model
File "pydantic/fields.py", line 860, in pydantic.fields.ModelField.validate
pydantic.errors.ConfigError: field "image_manual_modes" not yet prepared so type is still a ForwardRef, you might need to call Config.update_forward_refs().
Reproduction steps:
How can we recreate the bug?
Create a prodigy.json
with contents:
{
"image_manual_modes": ["rect", "polygon", "freehand"]
}
Then run
> prodigy image.manual my_dataset ./images --label PERSON
Environment variables:
Please provide prodigy stats
or Python version/OS/Prodigy version:
============================== ✨ Prodigy Stats ==============================
Version 1.12.7
Location /Users/adambozson/Library/Caches/pypoetry/virtualenvs/bl-ocr-WI3q7U0s-py3.11/lib/python3.11/site-packages/prodigy
Prodigy Home /Users/adambozson/.prodigy
Platform macOS-13.5.1-arm64-arm-64bit
Python Version 3.11.4
Spacy Version 3.6.1
Database Name SQLite
Database Id sqlite
Total Datasets 1
Total Sessions 7
Pydantic version: 1.10.12