Same command not working after upgrading prodigy to 1.10.8

Here is the command I've been using successfully to start the review task with version 1.8.5:

prodigy custom_mark dpc_retrain_games_21Q2_manrev_batch1_rev3 data/dpc_retrain_games_21Q2_manrev_batch1_rev3_input.jsonl -F custom_domain_top_5.py -v choice -M -p 82`

After upgrading to 1.10.8 and running the same command, I get:

13:52:11: RECIPE: Calling recipe 'custom_mark'

Dataset ID: dpc_retrain_games_21Q2_manrev_batch1_rev3

13:52:11: RECIPE: Starting recipe mark

✘ The --view-id argument (annotation UI to use) is required

Tried with --view-id=choice as well.

Hi!

Am I correct in assuming that custom_mark is a custom recipe you've written in the file custom_domain_top_5.py? And that this custom_mark recipe perhaps calls Prodigy's built-in mark recipe?

If so - you need to make sure that the custom recipe custom_mark sets the view_id of mark properly - in other words, that it passes either your input along, or sets it as choice by default. Because the mark recipe was indeed upgraded to require this view_id.

Let me know if that solves your issue or not!

Yes, that's correct. Do you have an example of how to set it properly? Here is what I have currently:

@prodigy.recipe('custom_mark',
dataset=('Dataset ID', 'positional', None, str),
view_id=('Annotation interface', 'option', 'v', 'domain_top_5'),
memorize=('Enable answer cache', 'flag', 'M', bool),
port=('Port to run application on', 'option', 'p', str),
exclude=('Exclude data from dataset', 'option', 'e', str)
)

Calling:

(py3.8) dpc@prodigy-server1:~/dpc# prodigy custom_mark dpc_retrain_games_21Q2_manrev_batch1_rev3 data/dpc_retrain_games_21Q2_manrev_batch1_rev3_input.jsonl -F custom_domain_top_5.py -v domain_top_5 -M -p 82

Resulting in:

15:46:51: RECIPE: Calling recipe 'custom_mark'
Traceback (most recent call last):
File "/root/miniconda3/envs/py3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/root/miniconda3/envs/py3.8/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/miniconda3/envs/py3.8/lib/python3.8/site-packages/prodigy/main.py", line 53, in
controller = recipe(*args, use_plac=True)
File "cython_src/prodigy/core.pyx", line 321, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File "/root/miniconda3/envs/py3.8/lib/python3.8/site-packages/plac_core.py", line 363, in call
parser = parser_from(obj)
File "/root/miniconda3/envs/py3.8/lib/python3.8/site-packages/plac_core.py", line 147, in parser_from
parser.populate_from(obj)
File "/root/miniconda3/envs/py3.8/lib/python3.8/site-packages/plac_core.py", line 318, in populate_from
self.add_argument(
File "/root/miniconda3/envs/py3.8/lib/python3.8/argparse.py", line 1373, in add_argument
raise ValueError('%r is not callable' % (type_func,))
ValueError: 'domain_top_5' is not callable

What are you trying to achieve with the domain_top_5 here? The recipe arguments describe the arguments available on the CLI and the 4th element here should be the value type of converter function, e.g. str if the expected value is a string, etc. So you probably want this to be str here, so you can write --view-id text on the CLI and the argument your function gets is the string "text". Also see here for a more detailed explanation: Custom Recipes · Prodigy · An annotation tool for AI, Machine Learning & NLP

In your function, you just need to make sure to pass this value correctly to whatever you're calling under the hood, e.g. the mark function.

My mistake with the 4th element, I forgot to change it back to str after experimening.

I got everything working by passing in view_id directly to mark (while before it was set as a property of resulting dictionary).

Great, happy to hear it!