Compare commits

...

3 Commits

Author SHA1 Message Date
6909770bcc Add auto-translation with GPT-4 2023-04-24 18:31:52 +01:00
41103c6405 Fix model.fit() and the dataset section too 2023-04-24 16:58:05 +01:00
c5b5d4b8c7 Fix TF example in quicktour 2023-04-24 13:52:05 +01:00
3 changed files with 1291 additions and 3 deletions

View File

@ -528,7 +528,7 @@ All models are a standard [`tf.keras.Model`](https://www.tensorflow.org/api_docs
```py
>>> dataset = dataset.map(tokenize_dataset) # doctest: +SKIP
>>> tf_dataset = model.prepare_tf_dataset(
... dataset, batch_size=16, shuffle=True, tokenizer=tokenizer
... dataset["train"], batch_size=16, shuffle=True, tokenizer=tokenizer
... ) # doctest: +SKIP
```
@ -538,7 +538,7 @@ All models are a standard [`tf.keras.Model`](https://www.tensorflow.org/api_docs
>>> from tensorflow.keras.optimizers import Adam
>>> model.compile(optimizer=Adam(3e-5))
>>> model.fit(dataset) # doctest: +SKIP
>>> model.fit(tf_dataset) # doctest: +SKIP
```
## What's next?

View File

@ -247,7 +247,7 @@ reduces the number of padding tokens compared to padding the entire dataset.
```py
>>> tf_dataset = model.prepare_tf_dataset(dataset, batch_size=16, shuffle=True, tokenizer=tokenizer)
>>> tf_dataset = model.prepare_tf_dataset(dataset["train"], batch_size=16, shuffle=True, tokenizer=tokenizer)
```
Note that in the code sample above, you need to pass the tokenizer to `prepare_tf_dataset` so it can correctly pad batches as they're loaded.

File diff suppressed because it is too large Load Diff