MCPcopy Create free account
hub / github.com/AlayaLab/Hive / load_audiosep

Function load_audiosep

app.py:106–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104
105
106def load_audiosep():
107 global _audiosep_model
108 device = get_runtime_device()
109 if _audiosep_model is not None:
110 _audiosep_model = _audiosep_model.to(device).eval()
111 return _audiosep_model
112
113 from models.clap_encoder import CLAP_Encoder
114 from utils import parse_yaml, load_ss_model
115
116 clap_ckpt = hf_hub_download(repo_id="ShandaAI/AudioSep-hive", filename="music_speech_audioset_epoch_15_esc_89.98.pt")
117 query_encoder = CLAP_Encoder(pretrained_path=clap_ckpt).eval()
118
119 config_file = hf_hub_download(repo_id="ShandaAI/AudioSep-hive", filename="config.yaml")
120 checkpoint_file = hf_hub_download(repo_id="ShandaAI/AudioSep-hive", filename="audiosep_hive.ckpt")
121 configs = parse_yaml(config_file)
122 model = load_ss_model(configs=configs, checkpoint_path=checkpoint_file, query_encoder=query_encoder)
123 model = model.to(device).eval()
124 _audiosep_model = model
125 return model
126
127
128def load_flowsep():

Callers 1

separate_audiosepFunction · 0.85

Calls 5

CLAP_EncoderClass · 0.90
parse_yamlFunction · 0.90
load_ss_modelFunction · 0.90
get_runtime_deviceFunction · 0.85
toMethod · 0.45

Tested by

no test coverage detected