Constraints on the tensor-to-scalar ratio for non-power-law models