Skip to content

Commit

Permalink
Fix dataset example
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoin committed Jun 6, 2024
1 parent 5495e4c commit 7554cbc
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(512)
ds = load_dataset("mgoin/ultrachat_2k", split="train_sft").select(range(512))
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 7554cbc

Please sign in to comment.