MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS-TTS / save

Method save

moss_soundeffect_v2/diffsynth/models/dac_vae.py:31–47  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

29 dac_version: str
30
31 def save(self, path):
32 artifacts = {
33 "codes": self.codes.numpy().astype(np.uint16),
34 "metadata": {
35 "input_db": self.input_db.numpy().astype(np.float32),
36 "original_length": self.original_length,
37 "sample_rate": self.sample_rate,
38 "chunk_length": self.chunk_length,
39 "channels": self.channels,
40 "padding": self.padding,
41 "dac_version": SUPPORTED_VERSIONS[-1],
42 },
43 }
44 path = Path(path).with_suffix(".dac")
45 with open(path, "wb") as f:
46 np.save(f, artifacts)
47 return path
48
49 @classmethod
50 def load(cls, path):

Callers 10

mainFunction · 0.80
extractFunction · 0.80
_save_waveformFunction · 0.80
synthesize_streamFunction · 0.80
extractFunction · 0.80
mainFunction · 0.80
save_audioMethod · 0.80
on_epoch_endMethod · 0.80
save_modelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected