Harden image fetch algorithm
Prepare for database integration
This commit is contained in:
@@ -301,7 +301,7 @@ class ModelPackageSubRepository:
|
||||
internal = True
|
||||
break
|
||||
|
||||
pulled = list()
|
||||
pulled: list[ModelPackage] = list()
|
||||
for candidate in to_pull:
|
||||
package_path = self.path / candidate['uuid']
|
||||
if os.path.exists(str(Path(package_path) / "package.json")): raise RuntimeError("package exists!")
|
||||
@@ -357,13 +357,15 @@ class ModelPackageSubRepository:
|
||||
pulled.append(package)
|
||||
|
||||
for package in pulled:
|
||||
info = package.info
|
||||
print('Collections for package:')
|
||||
print(f' {'N':<{2}} {'version':<{10}} {'type':<{10}} {'release_date':<{25}}'
|
||||
f' {'lineage':<{10}} {'quant':<{5}} {'size':<{10}} ')
|
||||
# TODO fix it
|
||||
print(
|
||||
f' {'N':<{2}} {candidate['version']:<{10}} {candidate['package_type']:<{10}} {candidate['release_date']:<{25}}'
|
||||
f' {candidate['lineage']:<{10}} {candidate['quantisation']:<{5}} {format_bytes(candidate['size_bytes']):<{10}} ')
|
||||
f' {'N':<{2}} {info.version:<{10}} {info.package_type:<{10}} {info.release_date:<{25}}'
|
||||
f' {info.lineage:<{10}} {info.quantization:<{5}} {format_bytes(info.size_bytes):<{10}} ')
|
||||
|
||||
self._add_package_to_collections_interactive(package)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user