Unverified Commit e27500b7 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[From ckpt] replace with os path join (#3746)

replace with os path join
parent fe5911bf
...@@ -1476,8 +1476,8 @@ class FromSingleFileMixin: ...@@ -1476,8 +1476,8 @@ class FromSingleFileMixin:
ckpt_path = Path(pretrained_model_link_or_path) ckpt_path = Path(pretrained_model_link_or_path)
if not ckpt_path.is_file(): if not ckpt_path.is_file():
# get repo_id and (potentially nested) file path of ckpt in repo # get repo_id and (potentially nested) file path of ckpt in repo
repo_id = "/".join(ckpt_path.parts[:2]) repo_id = os.path.join(*ckpt_path.parts[:2])
file_path = "/".join(ckpt_path.parts[2:]) file_path = os.path.join(*ckpt_path.parts[2:])
if file_path.startswith("blob/"): if file_path.startswith("blob/"):
file_path = file_path[len("blob/") :] file_path = file_path[len("blob/") :]
......
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