Skip to content

Commit

Permalink
Update Example to reflect #aa35fec (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
nautsimon authored Feb 18, 2024
1 parent 1bfe0b8 commit 1f56bff
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ def return_prompt_and_responses(samples) -> Dict[str, str]:
name for name, buffer in model.named_buffers() if buffer.dtype == torch.bool
]

model_ref = AutoModelForCausalLM.from_pretrained(
script_args.model_name_or_path,
low_cpu_mem_usage=True,
torch_dtype=torch.float16,
load_in_4bit=True,
)
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")
tokenizer.pad_token = tokenizer.eos_token

Expand Down Expand Up @@ -203,7 +197,7 @@ def return_prompt_and_responses(samples) -> Dict[str, str]:
# 5. initialize the DPO trainer
dpo_trainer = DPOTrainer(
model,
model_ref,
ref_model=None,
args=training_args,
beta=script_args.beta,
train_dataset=train_dataset,
Expand Down

0 comments on commit 1f56bff

Please sign in to comment.