Skip to content

Commit

Permalink
fix: rename config params
Browse files Browse the repository at this point in the history
  • Loading branch information
harshraj172 committed Oct 3, 2023
1 parent 795ac40 commit 98af307
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions configs/initial_run.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
toy: false
peft_method: qlora
base_run_name: llama2-7b-{peft_method}
qlora: true
base_run_name: llama2-7b-{method}

batch_size: 8
save_data_points: 5000
Expand Down
6 changes: 3 additions & 3 deletions llama2_qlora.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def parse_arguments():
with open(args.file) as file:
try:
config = yaml.safe_load(file)
config['base_run_name'] = config['base_run_name'].format(peft_method=config['peft_method'])
config['base_run_name'] = config['base_run_name'].format(method='qlora') if config['qlora'] else config['base_run_name'].format(method='lora')
except yaml.YAMLError as exc:
print(f'Error in configuration file: {exc}')

Expand All @@ -45,7 +45,7 @@ def parse_arguments():

# TODO: make a dataclass or pydantic model for this
TOY = config['toy']
PEFT_METHOD = config['peft_method']
USE_QLORA = config['qlora']
HF_CACHE_DIR = config.get('huggingface', {}).get('cache_dir')
LR = config.get('lr', 2e-4)
BATCH_SIZE = config.get('batch_size', 1)
Expand All @@ -70,7 +70,7 @@ def parse_arguments():

# model_id = "codellama/CodeLlama-7b-Instruct-hf"
bnb_config = None
if PEFT_METHOD=='qlora':
if USE_QLORA:
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
Expand Down

0 comments on commit 98af307

Please sign in to comment.