That's pretty much an oxymoron, and prohibiting training AI model with the code would basically make it not open source.