I don't know that they'd be able to keep up with them, like the other commenter said.
Something that's always worked a treat for me is to mix up some apple cider vinegar, some dish soap (I think they call it fairy liquid or washing up liquid in the UK?), and a little bit of sugar. I usually use a mason jar and put a little over an inch of apple cider vinegar in, then add the rest and stir it up. The vinegar and sugar attracts the gnats and the dish soap helps keep them from being able to escape once they touch the mixture. It works really well and I always find way more gnats in there than I even realized I had, lol. If it's a big space, I'd put a few scattered around.
It does smell like vinegar, though... but I've found it's worth it. It completely took care of the issue a few different times (until they're introduced again, but there's a lot of gnat-free time in between for me.)