  In this paper, we present a cosmology-independent method to constrain
cosmological models from the latest 221 gamma-ray bursts (GRBs) sample,
including 49 GRBs from Fermi catalog with the Amati relation (the $E_{\rm
p}$-${E}_{\rm iso}$ correlation), which calibrated by using a Gaussian process
from the Pantheon+ type Ia supernovae (SNe Ia) sample. With 182 GRBs at $0.8\le
z\le8.2$ in the Hubble diagram and the latest observational Hubble data (OHD)
by the Markov Chain Monte Carlo (MCMC) method, we obtained $\Omega_{\rm m}$ =
$0.348^{+0.048}_{-0.066}$ and $h$ = $0.680^{+0.029}_{-0.029}$ for the flat
$\Lambda$CDM model, and $\Omega_{\rm m}$ = $0.318^{+0.067}_{-0.059}$, $h$ =
$0.704^{+0.055}_{-0.068}$, $w$ = $-1.21^{+0.32}_{-0.67}$ for the flat $w$CDM
model. These results are consistent with those in which the coefficients of the
Amati relation and the cosmological parameters fitted simultaneously.
