We examine how the atomic and molecular gas components of galaxies evolve to higher redshifts using the semi-analytic galaxy formation models of Fu et al. in which we track the surface density profiles of gas in discs. We adopt two different prescriptions based either on gas surface density and metallicity or on interstellar pressure, to compute the molecular fraction as a function of radius in each disc. We demonstrate that the adopted star formation law determines how the balance between gas, stars and metals changes with time in the star-forming galaxy population, but does not influence the total mass in stars formed into galaxies at redshifts below z ∼ 2.5. The redshift evolution of the mass–metallicity relation places strong constraints on the time-scale over which cold gas is converted into stars in high-redshift galaxies, and favours models where this remains constant at values around 1–2 Gyr. Future observations of the evolution of the average molecular-to-atomic gas ratio in galaxies as a function of stellar mass and redshift will constrain models of the atomic-to-molecular transition.