My view is that it's good to allow AI training to use your code. This democratises AI models, otherwise AI will be the exclusive preserve of wealthy corporations. So I say, let's license our code under permissive, no attribution licences!
I default to MIT license for anything open source that I make for 2 reasons. Firstly it’s compatible with pretty much every other license, and secondly it is written in clear, simple, unambiguous plain English.