Upload artifact.py with huggingface_hub
Browse files214 unmodified lines215216217218219220221222218219220221222223224225226227214 unmodified lines
@classmethod def load(cls, path): with open(path, "r") as f: d = json.load(f)
assert "type" in d, "Saved artifact must have a type field" return cls._recursive_load(d) try: with open(path, "r") as f: d = json.load(f) assert "type" in d, "Saved artifact must have a type field" return cls._recursive_load(d) except Exception as e: raise IOError(f"Failed loading {cls.type} from {path}")
def prepare(self): passartifact.py+7-5