label-studio-ml-backend
label-studio-ml-backend copied to clipboard
Workaround to avoid duplicate annotations
https://github.com/HumanSignal/label-studio/issues/6312 causes an extra call to predict
when 'Submit' is clicked, causing duplicate predictions. This is a workaround that shouldn't impact the functionality (handling an edge case that shouldn't happen anyway) and will prevent the problem by returning empty annotations the second time (when the prompt is duplicated).
This assumes the auto-annotation has been used before clicking submit. If it weren't used then the prompt length would be 1 and this fix wouldn't work. As stated, this is a workaround, the real fix should be to avoid LabelStudio calling the prediction endpoint on submit.