wenmengzhou commited on
Commit
589560d
1 Parent(s): b75789c

Update cosyvoice/cli/cosyvoice.py

Browse files
Files changed (1) hide show
  1. cosyvoice/cli/cosyvoice.py +2 -2
cosyvoice/cli/cosyvoice.py CHANGED
@@ -14,7 +14,7 @@
14
  import os
15
  import torch
16
  from hyperpyyaml import load_hyperpyyaml
17
- from modelscope import snapshot_download
18
  from cosyvoice.cli.frontend import CosyVoiceFrontEnd
19
  from cosyvoice.cli.model import CosyVoiceModel
20
 
@@ -24,7 +24,7 @@ class CosyVoice:
24
  instruct = True if '-Instruct' in model_dir else False
25
  self.model_dir = model_dir
26
  if not os.path.exists(model_dir):
27
- model_dir = snapshot_download(model_dir)
28
  with open('{}/cosyvoice.yaml'.format(model_dir), 'r') as f:
29
  configs = load_hyperpyyaml(f)
30
  self.frontend = CosyVoiceFrontEnd(configs['get_tokenizer'],
 
14
  import os
15
  import torch
16
  from hyperpyyaml import load_hyperpyyaml
17
+ from huggingface_hub import snapshot_download
18
  from cosyvoice.cli.frontend import CosyVoiceFrontEnd
19
  from cosyvoice.cli.model import CosyVoiceModel
20
 
 
24
  instruct = True if '-Instruct' in model_dir else False
25
  self.model_dir = model_dir
26
  if not os.path.exists(model_dir):
27
+ model_dir = snapshot_download(model_dir, local_dir=model_dir)
28
  with open('{}/cosyvoice.yaml'.format(model_dir), 'r') as f:
29
  configs = load_hyperpyyaml(f)
30
  self.frontend = CosyVoiceFrontEnd(configs['get_tokenizer'],