MCPcopy
hub / github.com/descriptinc/descript-audio-codec / load

Method load

dac/model/base.py:47–54  ·  view source on GitHub ↗
(cls, path)

Source from the content-addressed store, hash-verified

45
46 @classmethod
47 def load(cls, path):
48 artifacts = np.load(path, allow_pickle=True)[()]
49 codes = torch.from_numpy(artifacts["codes"].astype(int))
50 if artifacts["metadata"].get("dac_version", None) not in SUPPORTED_VERSIONS:
51 raise RuntimeError(
52 f"Given file {path} can't be loaded with this version of descript-audio-codec."
53 )
54 return cls(codes=codes, **artifacts["metadata"])
55
56
57class CodecMixin:

Callers 5

decodeFunction · 0.80
load_modelFunction · 0.80
decompressMethod · 0.80
mainFunction · 0.80
test_compressionFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_compressionFunction · 0.64