Skip to content

Commit

Permalink
Changing tokenized_dataset to tokenized_datasets
Browse files Browse the repository at this point in the history
Changing `tokenized_dataset` to `tokenized_datasets`
  • Loading branch information
osanseviero authored May 17, 2024
2 parents 7065a5f + 9f55f69 commit 93e49a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions chapters/en/chapter7/6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ Now we can use the `prepare_tf_dataset()` method to convert our datasets to Tens

```python
tf_train_dataset = model.prepare_tf_dataset(
tokenized_dataset["train"],
tokenized_datasets["train"],
collate_fn=data_collator,
shuffle=True,
batch_size=32,
)
tf_eval_dataset = model.prepare_tf_dataset(
tokenized_dataset["valid"],
tokenized_datasets["valid"],
collate_fn=data_collator,
shuffle=False,
batch_size=32,
Expand Down Expand Up @@ -726,9 +726,9 @@ Let's start with the dataloaders. We only need to set the dataset's format to `"
```py
from torch.utils.data.dataloader import DataLoader

tokenized_dataset.set_format("torch")
train_dataloader = DataLoader(tokenized_dataset["train"], batch_size=32, shuffle=True)
eval_dataloader = DataLoader(tokenized_dataset["valid"], batch_size=32)
tokenized_datasets.set_format("torch")
train_dataloader = DataLoader(tokenized_datasets["train"], batch_size=32, shuffle=True)
eval_dataloader = DataLoader(tokenized_datasets["valid"], batch_size=32)
```

Next, we group the parameters so that the optimizer knows which ones will get an additional weight decay. Usually, all bias and LayerNorm weights terms are exempt from this; here's how we can do this:
Expand Down

0 comments on commit 93e49a8

Please sign in to comment.