Skip to content

Commit

Permalink
Fix return_url of HfApi client (#1040)
Browse files Browse the repository at this point in the history
Since v0.20, the attribute is a dataclass object, not a string anymore.
  • Loading branch information
BenjaminBossan authored Jan 8, 2024
1 parent 2bb50a3 commit 0d3a8ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions skorch/hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0d3a8ec

Please sign in to comment.