Implemented training methods to train the generator from strings and files