Views
No views yet
1# Clone the repository
2git clone https://github.com/yourusername/PassphraseGPT.git
3cd PassphraseGPT
4
5# Install dependencies
6pip install -r requirements.txt1# Execution-wide parameters
2config_args:
3 seed: 14
4 maxchars: 16 # Maximum tokens to be in your verbal passwords
5 subsample: -1 # -1 means no subsampling training data
6 tokenizer_path: 'tokenizer/wordpiece/' # Path or huggingface name for your tokenizer
7 train_data_path: 'data/passphrase/phrases.txt' # Path to your training data
8 #eval_data_path: 'data/passphrase/test_set.txt' # Path to evaluation data (optional)
9
10# Details for model architecture (GPT2Config parameters)
11model_args:
12 n_head: 12
13 n_layer: 8
14
15# Training arguments (Transformers TrainingArguments)
16training_args:
17 per_device_train_batch_size: 512
18 gradient_accumulation_steps: 1
19 logging_steps: 250
20 save_total_limit: 1
21 num_train_epochs: 3
22 overwrite_output_dir: true
23 fp16: false
24 output_dir: './pretrain/PassphraseGPT/' # Where to store checkpoints
25 report_to: "wandb"
26 save_steps: 5000
27
28# Password generation parameters
29generation_args:
30 out_path: './generated/' # Path to store the generations
31 filename: "generated_phrases.txt" # Filename where generations will be stored
32 num_generate: 10000 # Number of passwords to generate
33 batch_size: 1000 # Batch size for generation
34 seed_offset: 0 # Random seed offset for generation
35 device: 'cuda' # Device to run execution ('cuda' or 'cpu')
36 num_beams: 1 # Number of beams for sampling
37 top_p: 100 # Probability for nucleus sampling (0-100)
38 top_k: null # Sample only from k tokens with highest probability (null = disabled)
39 temperature: 1.0 # Sampling temperaturepython tokenizer_train.py --config config.yamlpython train.py --config config.yamlpython generate.py --config config.yamldevice parameter in the generation_args section of your configuration file:1# For GPU
2generation_args:
3 device: 'cuda'
4 # other parameters...
5
6# For CPU
7generation_args:
8 device: 'cpu'
9 # other parameters...