Unverified Commit c4374928 authored by Matt's avatar Matt Committed by GitHub
Browse files

Example script for PushToHubCallback (#15375)

* Example script for PushToHubCallback

* Expanding description slightly
parent 8f6454bf
...@@ -241,7 +241,21 @@ class KerasMetricCallback(Callback): ...@@ -241,7 +241,21 @@ class KerasMetricCallback(Callback):
class PushToHubCallback(Callback): class PushToHubCallback(Callback):
""" """
Callback that will save and push the model to the Hub regularly. Callback that will save and push the model to the Hub regularly. By default, it pushes once per epoch, but this can
be changed with the `save_strategy` argument. Pushed models can be accessed like any other model on the hub, such
as with the `from_pretrained` method.
```py
from transformers.keras_callbacks import PushToHubCallback
push_to_hub_callback = PushToHubCallback(
output_dir="./model_save",
tokenizer=tokenizer,
hub_model_id="gpt5-7xlarge",
)
model.fit(train_dataset, callbacks=[push_to_hub_callback])
```
Args: Args:
output_dir (`str`): output_dir (`str`):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment