These two sectors have been boosted by AI hopes. Why investors should buy one, and trim exposure to the other.