Having a class in the early morning, so sleepy.
I am not sure what your intention is with this sentence. Are you talking about a class that you are in right now? Or a class that you will attend in the immediate future?
If you are in class right now and feeling sleepy, how about -
I am in class right now, and I'm so sleepy.
If it is a class that you are about to attend in the immediate future, try -
I have to attend class, but I'm so sleepy.