Controllable carrier polarity in 2D HfS2(1-x)Te2x for short-wave infrared photodiodes