L0SG commited on
Commit
f931e19
1 Parent(s): b9ee94c
Files changed (1) hide show
  1. bigvgan.py +15 -11
bigvgan.py CHANGED
@@ -304,17 +304,21 @@ class BigVGAN(
304
  ##################################################################
305
  # download and load hyperparameters (h) used by BigVGAN
306
  ##################################################################
307
- config_file = hf_hub_download(
308
- repo_id=model_id,
309
- filename='config.json',
310
- revision=revision,
311
- cache_dir=cache_dir,
312
- force_download=force_download,
313
- proxies=proxies,
314
- resume_download=resume_download,
315
- token=token,
316
- local_files_only=local_files_only,
317
- )
 
 
 
 
318
  h = load_hparams_from_json(config_file)
319
 
320
  ##################################################################
 
304
  ##################################################################
305
  # download and load hyperparameters (h) used by BigVGAN
306
  ##################################################################
307
+ if os.path.isdir(model_id):
308
+ print("Loading config.json from local directory")
309
+ config_file = os.path.join(model_id, 'config.json')
310
+ else:
311
+ config_file = hf_hub_download(
312
+ repo_id=model_id,
313
+ filename='config.json',
314
+ revision=revision,
315
+ cache_dir=cache_dir,
316
+ force_download=force_download,
317
+ proxies=proxies,
318
+ resume_download=resume_download,
319
+ token=token,
320
+ local_files_only=local_files_only,
321
+ )
322
  h = load_hparams_from_json(config_file)
323
 
324
  ##################################################################