jadechoghari commited on
Commit
a705269
1 Parent(s): 9a4a82b

Update infer/infer_mos5.py

Browse files
Files changed (1) hide show
  1. infer/infer_mos5.py +1 -8
infer/infer_mos5.py CHANGED
@@ -12,17 +12,10 @@ import sys
12
 
13
  from qa_mdt.audioldm_train.utilities.data.dataset_original_mos5 import AudioDataset as AudioDataset
14
  from qa_mdt.audioldm_train.utilities.tools import build_dataset_json_from_list
 
15
  from torch.utils.data import DataLoader
16
  from pytorch_lightning import seed_everything
17
  from qa_mdt.audioldm_train.utilities.tools import get_restore_step
18
- def instantiate_from_config(config):
19
- if not "target" in config:
20
- if config == "__is_first_stage__":
21
- return None
22
- elif config == "__is_unconditional__":
23
- return None
24
- raise KeyError("Expected key `target` to instantiate.")
25
- return get_obj_from_str(config["target"])(**config.get("params", dict()))
26
 
27
 
28
  def infer(dataset_key, configs, config_yaml_path, exp_group_name, exp_name):
 
12
 
13
  from qa_mdt.audioldm_train.utilities.data.dataset_original_mos5 import AudioDataset as AudioDataset
14
  from qa_mdt.audioldm_train.utilities.tools import build_dataset_json_from_list
15
+ from qa_mdt.audioldm_train.utilities.model_util import instantiate_from_config
16
  from torch.utils.data import DataLoader
17
  from pytorch_lightning import seed_everything
18
  from qa_mdt.audioldm_train.utilities.tools import get_restore_step
 
 
 
 
 
 
 
 
19
 
20
 
21
  def infer(dataset_key, configs, config_yaml_path, exp_group_name, exp_name):