commit
Browse files- app.py +1 -1
- examples/tts/utils/cosyvoice/cli/cosyvoice.py +5 -5
- requirements.txt +0 -1
app.py
CHANGED
|
@@ -20,7 +20,7 @@ import pdb
|
|
| 20 |
import json
|
| 21 |
from pathlib import Path
|
| 22 |
from huggingface_hub import snapshot_download as hf_snapshot_download
|
| 23 |
-
from modelscope import snapshot_download as ms_snapshot_download
|
| 24 |
import spaces
|
| 25 |
import tempfile
|
| 26 |
import uuid
|
|
|
|
| 20 |
import json
|
| 21 |
from pathlib import Path
|
| 22 |
from huggingface_hub import snapshot_download as hf_snapshot_download
|
| 23 |
+
# from modelscope import snapshot_download as ms_snapshot_download
|
| 24 |
import spaces
|
| 25 |
import tempfile
|
| 26 |
import uuid
|
examples/tts/utils/cosyvoice/cli/cosyvoice.py
CHANGED
|
@@ -15,7 +15,7 @@ import os
|
|
| 15 |
import time
|
| 16 |
from tqdm import tqdm
|
| 17 |
from hyperpyyaml import load_hyperpyyaml
|
| 18 |
-
from modelscope import snapshot_download
|
| 19 |
import torch
|
| 20 |
from cosyvoice.cli.frontend import CosyVoiceFrontEnd
|
| 21 |
from cosyvoice.cli.model import CosyVoiceModel, CosyVoice2Model
|
|
@@ -29,8 +29,8 @@ class CosyVoice:
|
|
| 29 |
self.instruct = True if '-Instruct' in model_dir else False
|
| 30 |
self.model_dir = model_dir
|
| 31 |
self.fp16 = fp16
|
| 32 |
-
if not os.path.exists(model_dir):
|
| 33 |
-
|
| 34 |
with open('{}/cosyvoice.yaml'.format(model_dir), 'r') as f:
|
| 35 |
configs = load_hyperpyyaml(f)
|
| 36 |
assert get_model_type(configs) != CosyVoice2Model, 'do not use {} for CosyVoice initialization!'.format(model_dir)
|
|
@@ -143,8 +143,8 @@ class CosyVoice2(CosyVoice):
|
|
| 143 |
self.instruct = True if '-Instruct' in model_dir else False
|
| 144 |
self.model_dir = model_dir
|
| 145 |
self.fp16 = fp16
|
| 146 |
-
if not os.path.exists(model_dir):
|
| 147 |
-
|
| 148 |
with open('{}/cosyvoice.yaml'.format(model_dir), 'r') as f:
|
| 149 |
configs = load_hyperpyyaml(f, overrides={'qwen_pretrain_path': os.path.join(model_dir, 'CosyVoice-BlankEN')})
|
| 150 |
assert get_model_type(configs) == CosyVoice2Model, 'do not use {} for CosyVoice2 initialization!'.format(model_dir)
|
|
|
|
| 15 |
import time
|
| 16 |
from tqdm import tqdm
|
| 17 |
from hyperpyyaml import load_hyperpyyaml
|
| 18 |
+
# from modelscope import snapshot_download
|
| 19 |
import torch
|
| 20 |
from cosyvoice.cli.frontend import CosyVoiceFrontEnd
|
| 21 |
from cosyvoice.cli.model import CosyVoiceModel, CosyVoice2Model
|
|
|
|
| 29 |
self.instruct = True if '-Instruct' in model_dir else False
|
| 30 |
self.model_dir = model_dir
|
| 31 |
self.fp16 = fp16
|
| 32 |
+
# if not os.path.exists(model_dir):
|
| 33 |
+
# model_dir = snapshot_download(model_dir)
|
| 34 |
with open('{}/cosyvoice.yaml'.format(model_dir), 'r') as f:
|
| 35 |
configs = load_hyperpyyaml(f)
|
| 36 |
assert get_model_type(configs) != CosyVoice2Model, 'do not use {} for CosyVoice initialization!'.format(model_dir)
|
|
|
|
| 143 |
self.instruct = True if '-Instruct' in model_dir else False
|
| 144 |
self.model_dir = model_dir
|
| 145 |
self.fp16 = fp16
|
| 146 |
+
# if not os.path.exists(model_dir):
|
| 147 |
+
# model_dir = snapshot_download(model_dir)
|
| 148 |
with open('{}/cosyvoice.yaml'.format(model_dir), 'r') as f:
|
| 149 |
configs = load_hyperpyyaml(f, overrides={'qwen_pretrain_path': os.path.join(model_dir, 'CosyVoice-BlankEN')})
|
| 150 |
assert get_model_type(configs) == CosyVoice2Model, 'do not use {} for CosyVoice2 initialization!'.format(model_dir)
|
requirements.txt
CHANGED
|
@@ -53,7 +53,6 @@ loralib==0.1.2
|
|
| 53 |
Mako==1.3.5
|
| 54 |
Markdown==3.7
|
| 55 |
matplotlib==3.7.5
|
| 56 |
-
modelscope==1.18.1
|
| 57 |
more-itertools==10.5.0
|
| 58 |
mpmath==1.3.0
|
| 59 |
msgpack==1.1.0
|
|
|
|
| 53 |
Mako==1.3.5
|
| 54 |
Markdown==3.7
|
| 55 |
matplotlib==3.7.5
|
|
|
|
| 56 |
more-itertools==10.5.0
|
| 57 |
mpmath==1.3.0
|
| 58 |
msgpack==1.1.0
|