Theoretically, if you sign someone else's graduation thesis, you will be punished, but you can consult your teacher before making a decision. One is to go to your teacher immediately after you reply and ask the teacher to sign it. The other is to ask the teacher if he can give the information to his classmates the next day for them to sign.
If you need someone else to sign or sign on your behalf, you'd better keep the evidence that the other party agrees with your signature (speech recording or WeChat/SMS screenshot), and there will be no problem. Because these evidences are equivalent to the other party's power of attorney, you are the principal.
In the process of writing a thesis, communicate directly with the teacher as much as possible. You may not see him right away, but if you ask him carefully, he will definitely reply. If he is too busy to remember, remember to ask again in a few days.