Ensure model_local_dir does not mangle "C:\" on Windows

This commit is contained in:
Ashwin Bharambe 2024-11-24 14:18:59 -08:00
parent 9ddda91180
commit 34be07e0df

View file

@ -4,11 +4,10 @@
# This source code is licensed under the terms described in the LICENSE file in # This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree. # the root directory of this source tree.
import os from pathlib import Path
from .config_dirs import DEFAULT_CHECKPOINT_DIR from .config_dirs import DEFAULT_CHECKPOINT_DIR
def model_local_dir(descriptor: str) -> str: def model_local_dir(descriptor: str) -> str:
path = os.path.join(DEFAULT_CHECKPOINT_DIR, descriptor) return str(Path(DEFAULT_CHECKPOINT_DIR) / (descriptor.replace(":", "-")))
return path.replace(":", "-")