mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-24 03:59:23 +01:00
Fix some words (#318)
This commit is contained in:
@@ -13,8 +13,8 @@ from modelscope.utils.logger import get_logger
|
|||||||
|
|
||||||
logger = get_logger()
|
logger = get_logger()
|
||||||
|
|
||||||
curren_path = os.path.dirname(os.path.abspath(__file__))
|
current_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
template_path = os.path.join(curren_path, 'template')
|
template_path = os.path.join(current_path, 'template')
|
||||||
|
|
||||||
|
|
||||||
def subparser_func(args):
|
def subparser_func(args):
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from modelscope.utils.logger import get_logger
|
|||||||
|
|
||||||
logger = get_logger()
|
logger = get_logger()
|
||||||
|
|
||||||
curren_path = os.path.dirname(os.path.abspath(__file__))
|
current_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
template_path = os.path.join(curren_path, 'template')
|
template_path = os.path.join(current_path, 'template')
|
||||||
|
|
||||||
|
|
||||||
def subparser_func(args):
|
def subparser_func(args):
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ def batch(reader, batch_size, drop_last=False):
|
|||||||
# Batch size check
|
# Batch size check
|
||||||
batch_size = int(batch_size)
|
batch_size = int(batch_size)
|
||||||
if batch_size <= 0:
|
if batch_size <= 0:
|
||||||
raise ValueError('batch_size should be a positive integeral value, '
|
raise ValueError('batch_size should be a positive integer value, '
|
||||||
'but got batch_size={}'.format(batch_size))
|
'but got batch_size={}'.format(batch_size))
|
||||||
|
|
||||||
return batch_reader
|
return batch_reader
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ class BPETextField(object):
|
|||||||
print(f'Saved {len(examples)} examples (elapsed {elapsed:.2f}s)')
|
print(f'Saved {len(examples)} examples (elapsed {elapsed:.2f}s)')
|
||||||
else:
|
else:
|
||||||
print(f"Saving examples to '{filename}' ...")
|
print(f"Saving examples to '{filename}' ...")
|
||||||
raise ValueError(f'Unsport file format: {filename}')
|
raise ValueError(f'Unsupport file format: {filename}')
|
||||||
|
|
||||||
def load_examples(self, filename):
|
def load_examples(self, filename):
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def run_auto_label(input_wav,
|
|||||||
if not os.path.exists(work_dir):
|
if not os.path.exists(work_dir):
|
||||||
raise ValueError(f'work_dir: {work_dir} not exists')
|
raise ValueError(f'work_dir: {work_dir} not exists')
|
||||||
|
|
||||||
def _download_and_unzip_resousrce(model, model_revision=None):
|
def _download_and_unzip_resource(model, model_revision=None):
|
||||||
if os.path.exists(model):
|
if os.path.exists(model):
|
||||||
model_cache_dir = model if os.path.isdir(
|
model_cache_dir = model if os.path.isdir(
|
||||||
model) else os.path.dirname(model)
|
model) else os.path.dirname(model)
|
||||||
@@ -52,7 +52,7 @@ def run_auto_label(input_wav,
|
|||||||
revision=model_revision,
|
revision=model_revision,
|
||||||
user_agent={ThirdParty.KEY: 'speech_tts_autolabel'})
|
user_agent={ThirdParty.KEY: 'speech_tts_autolabel'})
|
||||||
if not os.path.exists(model_cache_dir):
|
if not os.path.exists(model_cache_dir):
|
||||||
raise ValueError(f'mdoel_cache_dir: {model_cache_dir} not exists')
|
raise ValueError(f'model_cache_dir: {model_cache_dir} not exists')
|
||||||
zip_file = os.path.join(model_cache_dir, 'model.zip')
|
zip_file = os.path.join(model_cache_dir, 'model.zip')
|
||||||
if not os.path.exists(zip_file):
|
if not os.path.exists(zip_file):
|
||||||
raise ValueError(f'zip_file: {zip_file} not exists')
|
raise ValueError(f'zip_file: {zip_file} not exists')
|
||||||
@@ -61,8 +61,8 @@ def run_auto_label(input_wav,
|
|||||||
target_resource = os.path.join(model_cache_dir, 'model')
|
target_resource = os.path.join(model_cache_dir, 'model')
|
||||||
return target_resource
|
return target_resource
|
||||||
|
|
||||||
model_resource = _download_and_unzip_resousrce(resource_model_id,
|
model_resource = _download_and_unzip_resource(resource_model_id,
|
||||||
resource_revision)
|
resource_revision)
|
||||||
auto_labeling = AutoLabeling(
|
auto_labeling = AutoLabeling(
|
||||||
os.path.abspath(input_wav),
|
os.path.abspath(input_wav),
|
||||||
model_resource,
|
model_resource,
|
||||||
|
|||||||
Reference in New Issue
Block a user