From 0d3a8ec4533d089dc30d2798134454a4c716b587 Mon Sep 17 00:00:00 2001 From: Benjamin Bossan Date: Mon, 8 Jan 2024 15:32:50 +0100 Subject: [PATCH] Fix return_url of HfApi client (#1040) Since v0.20, the attribute is a dataclass object, not a string anymore. --- skorch/hf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/skorch/hf.py b/skorch/hf.py index 6f21254e0..c370af122 100644 --- a/skorch/hf.py +++ b/skorch/hf.py @@ -1277,6 +1277,10 @@ def flush(self): repo_id=self.repo_id, **self.kwargs ) + if hasattr(return_url, 'commit_url'): + # starting from huggingface_hub, the return type is now a CommitInfo + # object instead of a string + return_url = return_url.commit_url self._buffer = None self._needs_flush = False