Isn't the definition of public repo that anyone is allowed to download and read it?
Other licenses such as the MIT license require that you name the original creator.
A license allows new uses that copyright would otherwise block. Some kinds of AI training are fully local and don't make the AI into a derivative work, so they don't need any attribution and you don't need to accept the license to distribute.