Ahmadzei's picture
added 3 more tables for large emb model
5fa1a76
Pass your compute_metrics function to [KerasMetricCallback],
and use the [PushToHubCallback] to upload the model:
from transformers.keras_callbacks import KerasMetricCallback, PushToHubCallback
metric_callback = KerasMetricCallback(
metric_fn=compute_metrics, eval_dataset=tf_eval_dataset, batch_size=batch_size, label_cols=["labels"]
)
push_to_hub_callback = PushToHubCallback(output_dir="scene_segmentation", tokenizer=image_processor)
callbacks = [metric_callback, push_to_hub_callback]
Finally, you are ready to train your model!