  We consider a generalized version of the Random Energy Model in which the
energy of each configuration is given by the sum of $N$ independent
contributions ("local energies") with finite variances but otherwise arbitrary
statistics. Using the large deviation formalism, we find that the glass
transition generically exists when local energies have a smooth distribution.
In contrast, if the distribution of the local energies has a {Dirac mass} at
the minimal energy (e.g., if local energies take discrete values), the glass
transition ceases to exist if the number of energy levels grows sufficiently
fast with system size. This shows that statistical independence of energy
levels does not imply the existence of a glass transition.
