generate training file