Molly Wei, the former Rutgers University freshmen accused of using a webcam to watch a male classmate's sexual encounter with another man, has been approved for a pretrial intervention program that will allow her to avoid criminal prosecution.

Under the deal with prosecutors, Wei, 18, of Princeton, N.J., pleaded not guilty Friday to two counts of invasion of privacy, according to the Middlesex County Prosecutor's Office.

In September, Wei and fellow 18-year-old freshman Dharun Ravi, of Plainsboro, N.J., were charged with two counts each of invasion of privacy for allegedly using a camera to view a live image of 18-year-old Tyler Clementi during a sexual encounter. Clementi, a resident of Ridgewood, N.J., was Ravi’s roommate.

On Sept. 21, Clementi posted a message online saying how upset he was over the spying. The following day, he leaped from the George Washington Bridge.

In April, a grand jury indicted Ravi on 15 counts, including a count of bias intimidation, which alone could result in a 10-year prison sentence.

As part of the pretrial intervention, Wei must attend counseling in cyberbulling and in dealing with alternative and cultural differences. She must also complete 300 hours of community service and testify against Ravi.

If Wei completes the program without getting into any additional trouble, all charges will be dropped, the prosecutor's office said.