Cleanup session.py (#16352)
This commit is contained in:
parent
ff2d268bdb
commit
e24a6f3b05
1 changed files with 0 additions and 10 deletions
|
|
@ -161,16 +161,6 @@ class HUBTrainingSession:
|
||||||
HUBModelError: If the identifier format is not recognized.
|
HUBModelError: If the identifier format is not recognized.
|
||||||
"""
|
"""
|
||||||
api_key, model_id, filename = None, None, None
|
api_key, model_id, filename = None, None, None
|
||||||
|
|
||||||
# path = identifier.split(f"{HUB_WEB_ROOT}/models/")[-1]
|
|
||||||
# parts = path.split("_")
|
|
||||||
# if Path(path).suffix in {".pt", ".yaml"}:
|
|
||||||
# filename = path
|
|
||||||
# elif len(parts) == 2 and len(parts[0]) == 42 and len(parts[1]) == 20:
|
|
||||||
# api_key, model_id = parts
|
|
||||||
# elif len(path) == 20:
|
|
||||||
# model_id = path
|
|
||||||
|
|
||||||
if Path(identifier).suffix in {".pt", ".yaml"}:
|
if Path(identifier).suffix in {".pt", ".yaml"}:
|
||||||
filename = identifier
|
filename = identifier
|
||||||
elif identifier.startswith(f"{HUB_WEB_ROOT}/models/"):
|
elif identifier.startswith(f"{HUB_WEB_ROOT}/models/"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue