Hello all.
I am new with Huggingface. I don’t know what really caused this problem, so I figured that best approach for it to be just asking here. I am having "AttributeError: module ‘datasets.metric’ has no attribute ‘compute’ " on my metric function.
def compute_metrics(eval_predictions):
predictions, labels = eval_predictions
return bertScore.compute(predictions=predictions, references=labels)
evalCallback= KerasMetricCallback(
metric_fn=compute_metrics, eval_dataset=tf_validation_dataset)
push_to_hub_callback = PushToHubCallback(
hub_token=hftoken,
output_dir=dir,
tokenizer=tokenizer,
hub_model_id=push_to_hub_model_id,
)
tensorboard_callback = TensorBoard(log_dir="{}/logs".format(dir))
callbacks = [tensorboard_callback, push_to_hub_callback, evalCallback]
model.fit(
tf_train_dataset,
validation_data=tf_validation_dataset,
epochs=num_epochs,
callbacks=callbacks
)
I tried digging into other topics or to the docs, and I couldn’t figure this out. What can I do? Thanks