Retail investors snapped up software and tech stocks following last week’s heavy selloff, largely brushing aside worries that advances in artificial-intelligence models could upend parts of the industry.