Yorkies are notorious for being hard to potty train. If you are going to get upset everytime she has an accident, be prepared to be upset a lot. My Daisy is 2.5 yrs old and will still have accidents.
4 months is awfully young to have such high expectations. You have got to keep your cool. Please don't punish her by putting her in her crate. Her crate should be a safe haven for her, not her time out area.
Get her a large xpen for the kitchen or a tiled area and put her food, water, toys and pee pads in there if you're afraid she'll pee on carpet.
I feel bad for your puppy