I would recommend using pears that are slightly ripe for this recipe. Unripe pears will work absolutely fine, they just might be a little more firm at the end of baking. This isn't a bad thing and I'd definitely recommend using an unripe pear instead of an overripe pear, which might affect the consistency of the chocolate sauce.