Skip to content

Commit

Permalink
Merge pull request dslaborg#3 from dslaborg/inference
Browse files Browse the repository at this point in the history
Inference and Postprocessing
  • Loading branch information
nesasio93 authored Oct 13, 2023
2 parents 25a03aa + 86adb9a commit 51acb4d
Show file tree
Hide file tree
Showing 3 changed files with 1,072 additions and 130 deletions.
39 changes: 20 additions & 19 deletions qlora.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,24 +806,25 @@ def on_evaluate(self, args, state, control, model, **kwargs):
fout.write(json.dumps(all_metrics))

if __name__ == "__main__":
custom_args = {"model_name_or_path": "meta-llama/Llama-2-7b-hf",
"output_dir": "./output/spkatt-7b-cues",
"data_seed": 42,
"save_steps": 200,
"evaluation_strategy": "no",
"dataloader_num_workers": 4,
"lora_modules": "all",
"bf16": True,
"dataset": "transformed_datasets/prompts_training/parsed_data_cues.jsonl",
"dataset_format": "input-output",
"source_max_len": 256,
"target_max_len": 64,
"per_device_train_batch_size": 16,
"gradient_accumulation_steps": 1,
"max_steps": 4000,
"learning_rate": 0.0002,
"lora_dropout": 0.1,
"seed": 0,
}
custom_args = {
"model_name_or_path": "meta-llama/Llama-2-7b-hf",
"output_dir": "./output/spkatt-7b-cues",
"data_seed": 42,
"save_steps": 200,
"evaluation_strategy": "no",
"dataloader_num_workers": 4,
"lora_modules": "all",
"bf16": True,
"dataset": "transformed_datasets/prompts_training/parsed_data_cues.jsonl",
"dataset_format": "input-output",
"source_max_len": 256,
"target_max_len": 64,
"per_device_train_batch_size": 16,
"gradient_accumulation_steps": 1,
"max_steps": 4000,
"learning_rate": 0.0002,
"lora_dropout": 0.1,
"seed": 0,
}

train(custom_args)
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ sentencepiece==0.1.99
jupyter==1.0.0
scipy==1.11.3
torch==2.0.1
Levenshtein==0.23.0
langchain==0.0.312
tqdm==4.66.1
datasets==2.14.5
Loading

0 comments on commit 51acb4d

Please sign in to comment.