Puppy jumping up and biting on walks

Hi everyone I got my Aussie puppy almost 5 weeks ago and it’s been mostly great, but she’s starting to get very difficult to take on walks. She is perfectly capable of behaving on walks and does so most of the time, but sometimes it’s like the devil gets ahold of her or something. She’ll suddenly start jumping up and biting my pants/legs etc. and whenever I ask her to stop, she occasionally starts barking and growling at me. I will admit, I have a bad habit of yanking the leash whenever she gets like this to create space and get her down, which I always feel terribly about. Usually getting her to sit and focus on me helps and she’ll walk on normally, but there are days where it’s just very difficult to handle this behaviour when she won’t stop. Any help and tips is greatly appreciated, I’m at my wits end with her when it comes to this.