It is easy to lose patience with little puppies, especially with potty training. I'd giving yourself A timeout by walking away and taking deep breaths. It won't help to physically spank and yell. It will make the puppy fearful or worse even run away from you.
It is just like with very young children, patience, consitency, and routine works much more effectivley.