Thanks! And I think I found the problem: Before you’re returning pic_json
, you’re calling json.dumps
on it, which turns it into a string. However, examples added to the database are expected to be just a regular list of dictionaries. So you can drop that line
I also just noticed that add_examples
currently expects the examples to already have hashes set (an "_input_hash"
representing the input data, e.g. the image, and a "_task_hash"
representing the specific question, e.g. the image with a given label). You can either generate them yourself, or let Prodigy do it for you:
from prodigy import set_hashes
# in your code
pic_json = set_hashes(pic_json)
return pic_json