the plant turns hermie because of genetics and the stress its under. incorrect changes in light cycle is a common cause. cut the balls off as they appear and harvest the female flowers. you'll probably get some seeds anyway
light leak? stress? it could be worse, it could be male. clip the male parts off to minimize pollination. if you have other females they could get seeded