mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Fix cached lookup filepath on windows for hub (#19178)
* Update hub.py commit_hash extraction Add safety mechanism for windows systems to unify logic (replace double backslashes with /) * Fix string quotetype * Aaaa circleci is messing with me. * Switch to using as_posix() method from pathlib * Update src/transformers/utils/hub.py Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * Update src/transformers/utils/hub.py Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
parent
f33858d18a
commit
6a08162ad4
@ -222,7 +222,7 @@ def extract_commit_hash(resolved_file: Optional[str], commit_hash: Optional[str]
|
||||
"""
|
||||
if resolved_file is None or commit_hash is not None:
|
||||
return commit_hash
|
||||
|
||||
resolved_file = str(Path(resolved_file).as_posix())
|
||||
search = re.search(r"snapshots/([^/]+)/", resolved_file)
|
||||
if search is None:
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user