Well, all I mean is identify them first so you can make a decision - if you can find out what kind of caterpillar they are, maybe you can relocate a few to another host plant so they can live, and you can keep your carrots going.
I can't see well enough in your picture to make a guess on what kind they are. Your first split picture is a little confusing to me as the carrot foliage on the left doesn't appear to have any worms or caterpillars on it, and the foliage to the right with the caterpillar is not carrot, is it? There are a lot of caterpillars that look like that one, too.