"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "258ed2eaa81046dfe109978db14e0ef8bc8461a1"
Unverified Commit 0ad45e10 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

[examples/seq2seq] fix PL deprecation warning (#8577)

* fix deprecation warning

* fix
parent 0e19a4c2
import logging import logging
import os
from pathlib import Path from pathlib import Path
import numpy as np import numpy as np
...@@ -98,7 +97,8 @@ def get_checkpoint_callback(output_dir, metric, save_top_k=1, lower_is_better=Fa ...@@ -98,7 +97,8 @@ def get_checkpoint_callback(output_dir, metric, save_top_k=1, lower_is_better=Fa
) )
checkpoint_callback = ModelCheckpoint( checkpoint_callback = ModelCheckpoint(
filepath=os.path.join(output_dir, exp), dirpath=output_dir,
filename=exp,
monitor=f"val_{metric}", monitor=f"val_{metric}",
mode="min" if "loss" in metric else "max", mode="min" if "loss" in metric else "max",
save_top_k=save_top_k, save_top_k=save_top_k,
......
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