Upload artifact.py with huggingface_hub
Browse files214 unmodified lines215216217218219220221222223224225214 unmodified lines@classmethoddef 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)def prepare(self):pass214 unmodified lines215216217218219220221222223224225226227214 unmodified lines@classmethoddef load(cls, path):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):pass
artifact.py+7-5