Ignore unrelated files during model version discovery
This commit is contained in:
parent
98efb8cb78
commit
4f603817b2
1 changed files with 12 additions and 11 deletions
|
|
@ -273,21 +273,15 @@ class LargeFileBase(ABC):
|
|||
def _find_instances_from_cache(self) -> List[DataInstance]:
|
||||
logger.info(f"Fetching cached versions of {self._name}")
|
||||
|
||||
candidates = [
|
||||
prefix = f"{self._name}{CACHE_NAME_VERSION_SEPARATOR}"
|
||||
return [
|
||||
DataInstance(
|
||||
name=CACHE_NAME_VERSION_SEPARATOR.join(
|
||||
f.name.split(CACHE_NAME_VERSION_SEPARATOR)[:-1]
|
||||
),
|
||||
version=int(f.name.split(CACHE_NAME_VERSION_SEPARATOR)[-1]),
|
||||
remote_path=f,
|
||||
)
|
||||
for f in self.cache_path.glob(
|
||||
f"{self._name}{CACHE_NAME_VERSION_SEPARATOR}*"
|
||||
name=self._name, version=int(f.name[len(prefix) :]), remote_path=f
|
||||
)
|
||||
for f in self.cache_path.glob(f"{prefix}*")
|
||||
if f.name[len(prefix) :].isdigit()
|
||||
]
|
||||
|
||||
return [c for c in candidates if c.name == self._name]
|
||||
|
||||
def _check_mode_and_set_version(self) -> None:
|
||||
if "+" in self._mode:
|
||||
raise ValueError(
|
||||
|
|
|
|||
Loading…
Reference in a new issue