You most like got them cos of overwatering, high temperatures and high humidity this is what gnats love. I have had this problem in past. I suggest u let ur plants dry out so they are nearly dry!! Keep temperature below 26c and get some neem oil and spray them a tiny bit on top of the soil!!! That’s what I would do!!! Hope it helps good luck brother need any other help message me!!!!!