can you remove a screen and place a small fan in the window blowing out? Run that for an hour and they should be sucked outside.
Apple cider vinegar in a jar or glass (about 1/2 cup). Add 2-3 drops of dishwashing liquid then 2-3 tbsps water (enough to make it start to foam). Add a piece of plastic wrap over the top secured with a rubber band. Poke holes in the plastic with a knife. They are attracted to the smell. They can get in holes but not smart enough to get out. Soap coats their wings and they drown.
Are they gnats or drain flies? Check and clean your sink drains well. These flies oftentimes develop in the sludge just above the trap in the sink. Here is a link to tell you how to remove them from your life. http://www.getridofthings.com/pests/flies/get-rid-of-drain-flies.htm
Go to Hardware store & ask for a box of "fly strips". I think there are 3 in a box. I use them all the time & they get COVERED with gnats in no time. Just leave it hang. Try not to touch it cause it really is sticky. When you open one of the thingys, pull down on the tab. It will hang down pretty far so make sure it is ABOVE the reach of small ones. You can also just set a jar in the Bath with about 1/4 cup of Vinegar. They will swarm to it just like that.
In small jar pour 1/4 cup Apple cider vinegar. Tightly stretch cling wrap over the top stretch a rubberband to help hold it tight. Poke 3 or 4 small holes in top 1/4 inch or so with a knife. Gnats smell the vinegar and go in the hole to investigate and die. Non toxic to dogs or humans