  Cosmological $\gamma$-ray bursts originate from relativistic winds. Temporal
fluctuations in the wind velocity can give rise to internal shocks which
dissipate a significant fraction of the wind kinetic energy. Part of the energy
dissipated is transferred to the electrons through Fermi acceleration. If the
post shock fluid is strongly magnetized, the relativistic electrons cool
initially through synchrotron emission, and later through Compton scattering.
The upsacttered radiation triggers a cascade of $e^{+}e^{-}$-pairs. We compute
the final spectrum for a wide range of parameter values for the emission
region. We show that the spectral diversity observed by BATSE can be naturally
explained by emission from internal shocks, which are associated with the
observed source variability.

Astrophysics