As Benjamin says in the comments, your class is totally off-track, if not a disaster. For whatever reason, most of your students have found themselves unable or unwilling to learn from you, and have either dropped the class, transferred to another section or just given up. This is a very strong signal that there was something fundamentally wrong with the way the course was being run. My main recommendation, therefore, is that you use this situation to reflect seriously upon what went wrong, to consider how you might run a better class in the future.
There are a number of ways that an instructor might drive an entire class away: an instructor could have totally unrealistic expectations; an instructor could be completely unapproachable; an instructor might be unfair or abusive; perhaps an instructor's remarks are unintelligible. I think the most common explanation for a situation where students aren't learning and the instructor doesn't realize it is that the instructor is teaching on too advanced a level, and doesn't get feedback about how little is being understood.
Probably none of those reasons applies to you. But since clearly something is wrong, you should try to think about what the problem was, so that you can fix the problem going forward.
As far as fixing the problem for this semester, perhaps some of your students have already dropped the class, and in this case you won't be getting them back. For the others, you should try to contact them---do you have a class email list to send an email inviting everyone back? (If not, then in the future make sure to get such a list.) It may be that some of them haven't realized that the exam was scheduled then, so you can remind the class of the exams. (In the future make sure the exam schedule is more clear.) With the few students you have left, make sure to teach in such a way that you get feedback during the class about whether they are understanding the material or not. Ask the students questions during the lecture (I do so dozens of times) concerning what you are lecturing on, since when they are unable to provide the answers, you can adjust the topic and pace.