mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
Make quote style consistent (#891)
This commit is contained in:
committed by
GitHub
parent
9276edbc37
commit
7ca7c47e4a
@@ -43,7 +43,7 @@ def combine_files(file_paths, target_dir, max_size_mb=500, separator="<|endoftex
|
||||
content = strip_headers(content)
|
||||
|
||||
# Regular expression to replace multiple blank lines with a single blank line
|
||||
content = re.sub(r'\n\s*\n', '\n\n', content)
|
||||
content = re.sub(r"\n\s*\n", "\n\n", content)
|
||||
estimated_size = len(content.encode("utf-8"))
|
||||
|
||||
if current_size + estimated_size > max_size_mb * 1024 * 1024:
|
||||
|
||||
@@ -148,26 +148,26 @@ def train_model_simple(model, optimizer, device, n_epochs,
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
parser = argparse.ArgumentParser(description='GPT Model Training Configuration')
|
||||
parser = argparse.ArgumentParser(description="GPT Model Training Configuration")
|
||||
|
||||
parser.add_argument('--data_dir', type=str, default='gutenberg/data',
|
||||
help='Directory containing the training data')
|
||||
parser.add_argument('--output_dir', type=str, default='model_checkpoints',
|
||||
help='Directory where the model checkpoints will be saved')
|
||||
parser.add_argument('--n_epochs', type=int, default=1,
|
||||
help='Number of epochs to train the model')
|
||||
parser.add_argument('--print_sample_iter', type=int, default=1000,
|
||||
help='Iterations between printing sample outputs')
|
||||
parser.add_argument('--eval_freq', type=int, default=100,
|
||||
help='Frequency of evaluations during training')
|
||||
parser.add_argument('--save_ckpt_freq', type=int, default=100_000,
|
||||
help='Frequency of saving model checkpoints during training')
|
||||
parser.add_argument('--lr', type=float, default=5e-4,
|
||||
help='Learning rate for the optimizer')
|
||||
parser.add_argument('--batch_size', type=int, default=4,
|
||||
help='Batch size for training')
|
||||
parser.add_argument('--debug', type=bool, default=False,
|
||||
help='Uses a very small model for debugging purposes')
|
||||
parser.add_argument("--data_dir", type=str, default="gutenberg/data",
|
||||
help="Directory containing the training data")
|
||||
parser.add_argument("--output_dir", type=str, default="model_checkpoints",
|
||||
help="Directory where the model checkpoints will be saved")
|
||||
parser.add_argument("--n_epochs", type=int, default=1,
|
||||
help="Number of epochs to train the model")
|
||||
parser.add_argument("--print_sample_iter", type=int, default=1000,
|
||||
help="Iterations between printing sample outputs")
|
||||
parser.add_argument("--eval_freq", type=int, default=100,
|
||||
help="Frequency of evaluations during training")
|
||||
parser.add_argument("--save_ckpt_freq", type=int, default=100_000,
|
||||
help="Frequency of saving model checkpoints during training")
|
||||
parser.add_argument("--lr", type=float, default=5e-4,
|
||||
help="Learning rate for the optimizer")
|
||||
parser.add_argument("--batch_size", type=int, default=4,
|
||||
help="Batch size for training")
|
||||
parser.add_argument("--debug", type=bool, default=False,
|
||||
help="Uses a very small model for debugging purposes")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user