Yes, you can get rid of responsibility. However, in order to do this, the principal borrower must agree with this decision. Moreover, the lender must also approve your release. As a rule, each lender has different criteria, but often if he sees that the borrower has a repayment history needed to qualify for the loan on his own, he can release you.
However, it should be understood that you cannot get out of a loan without the consent of the lender and the borrower. Thus, if you sign a contract and then change your mind, you will still be responsible for the debt on the loan. So, take this decision seriously.