The gamma-ray burst (GRB) afterglows provide an unique opportunity to study the interstellar medium (ISM) of star-forming galaxies at high-redshift. The GRB-DLAs (damped Lyman-α absorbers) contain a large neutral hydrogen column density, N(H I), and are observed against the GRB afterglow. A large fraction of GRB-DLAs show presence of molecular hydrogen (H 2 ) which is an indicator of star-formation. Hence it is important to study those GRB-DLAs which have H 2 lines to decipher and understand their physical conditions. The GRB-DLAs 121024A and 120815A, situated at redshift 2.30 and 2.36 respectively, are two such important H 2 -bearing GRB-DLAs. Besides H 2 , these two GRB-DLAs also show many metal lines. In this work we have carried out a detail numerical study on the H 2 lines, as well as on those metal lines, in GRB-DLAs 121024A and 120815A self-consistently. We use the spectral synthesis code CLOUDY for this study. This modeling helps us to determine the underlying physical conditions which give rise such lines and hence to understand these two GRB-DLAs in much more detail than any other previous investigation. We find that the hydrogen densities for these two H 2 -bearing DLAs are ≥ 60 cm −3 . Moreover our study infers that the linear sizes are ≤ 17.7 pc for these two GRB-DLAs, and the mean gas temperatures averaged over the cloud thickness, are ≤ 140 K. Overall, we find that these two H 2 -bearing GRB-DLAs are denser, cooler and smaller compared to those without H 2 .