Skip to content

Commit

Permalink
Apply isort and black reformatting
Browse files Browse the repository at this point in the history
Signed-off-by: yuanzhedong <[email protected]>
  • Loading branch information
yuanzhedong committed Jan 10, 2025
1 parent 35e850e commit b3b9261
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions examples/llm/peft/hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ def formatting_prompts_func(examples):
return ans

tokenizer = getattr(tokenizer, "tokenizer", tokenizer)
datamodule = llm.HFDatasetDataModule(
"rajpurkar/squad", split="train[:100]", pad_token_id=tokenizer.eos_token_id
)
datamodule = llm.HFDatasetDataModule("rajpurkar/squad", split="train[:100]", pad_token_id=tokenizer.eos_token_id)
datamodule.map(
formatting_prompts_func,
batched=False,
Expand All @@ -67,9 +65,7 @@ def main():

parser = argparse.ArgumentParser()
parser.add_argument("--model", default="meta-llama/Llama-3.2-1B")
parser.add_argument(
"--strategy", type=str, default="auto", choices=["auto", "ddp", "fsdp", "fsdp2"]
)
parser.add_argument("--strategy", type=str, default="auto", choices=["auto", "ddp", "fsdp", "fsdp2"])
parser.add_argument("--devices", type=int, default=1)
parser.add_argument("--accelerator", default="gpu", choices=["gpu"])
parser.add_argument("--max-steps", type=int, default=100)
Expand Down Expand Up @@ -103,9 +99,7 @@ def main():

callbacks = []
if args.use_torch_jit:
jit_config = JitConfig(
use_torch=True, torch_kwargs={"dynamic": True}, use_thunder=False
)
jit_config = JitConfig(use_torch=True, torch_kwargs={"dynamic": True}, use_thunder=False)
callbacks = [JitTransform(jit_config)]

llm.api.finetune(
Expand Down

0 comments on commit b3b9261

Please sign in to comment.