what is your residency based on? if you are already going through consular processing (with the USCIS in your country) you probably should finish it there.
if you are in the US for some reason, I guess you could file for AOS. But, I do not see why not complete your consular processing. I believe it would be faster and you would not risk going to the US while a immigration petition is pending for you, thus be denied entry.