Skip to content

Commit

Permalink
Update example_dataset.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoin authored Jul 1, 2024
1 parent 1958d07 commit 4b2092c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_dir, use_fast=True)
tokenizer.pad_token = tokenizer.eos_token

ds = load_dataset("mgoin/ultrachat_2k", split="train_sft").select(range(512))
ds = load_dataset("mgoin/ultrachat_2k", split="train_sft")
examples = [tokenizer.apply_chat_template(batch["messages"], tokenize=False) for batch in ds]
examples = tokenizer(examples, padding=True, truncation=True, return_tensors="pt").to("cuda")

Expand Down

0 comments on commit 4b2092c

Please sign in to comment.