diff --git a/ai_models/checkpoint.py b/ai_models/checkpoint.py index eef0a56..889557b 100644 --- a/ai_models/checkpoint.py +++ b/ai_models/checkpoint.py @@ -5,7 +5,6 @@ # granted to it by virtue of its status as an intergovernmental organisation # nor does it submit to any jurisdiction. -import json import logging import os import pickle @@ -50,24 +49,6 @@ def tidy(x): return x -def checkpoint_metadata(path, name="ai-models.json"): - with zipfile.ZipFile(path, "r") as f: - metadata = None - for b in f.namelist(): - if os.path.basename(b) == name: - if metadata is not None: - raise Exception( - f"Found two metadata.json files in {path}: {metadata} and {b}" - ) - metadata = b - - if metadata is not None: - with zipfile.ZipFile(path, "r") as f: - return json.load(f.open(metadata, "r")) - - return None - - def peek(path): with zipfile.ZipFile(path, "r") as f: data_pkl = None diff --git a/ai_models/model.py b/ai_models/model.py index e2bbfe1..e52e2cc 100644 --- a/ai_models/model.py +++ b/ai_models/model.py @@ -20,7 +20,7 @@ from climetlab.utils.humanize import seconds from multiurl import download -from .checkpoint import checkpoint_metadata, peek +from .checkpoint import peek from .inputs import get_input from .outputs import get_output from .stepper import Stepper @@ -396,9 +396,6 @@ def patch_retrieve_request(self, request): def peek_into_checkpoint(self, path): return peek(path) - def checkpoint_metadata(self, path): - return checkpoint_metadata(path) - def parse_model_args(self, args): if args: raise NotImplementedError(f"This model does not accept arguments {args}")