mirror of https://github.com/coqui-ai/TTS.git
move function and remove import
This commit is contained in:
parent
8f0519d203
commit
add97cddc1
|
@ -9,7 +9,6 @@ from typing import Union
|
||||||
|
|
||||||
from flask import Flask, render_template, request, send_file
|
from flask import Flask, render_template, request, send_file
|
||||||
|
|
||||||
from TTS.utils.generic_utils import style_wav_uri_to_dict
|
|
||||||
from TTS.utils.io import load_config
|
from TTS.utils.io import load_config
|
||||||
from TTS.utils.manage import ModelManager
|
from TTS.utils.manage import ModelManager
|
||||||
from TTS.utils.synthesizer import Synthesizer
|
from TTS.utils.synthesizer import Synthesizer
|
||||||
|
|
|
@ -165,20 +165,3 @@ def check_argument(
|
||||||
assert (
|
assert (
|
||||||
isinstance(c[name], val_type) or c[name] is None
|
isinstance(c[name], val_type) or c[name] is None
|
||||||
), f" [!] {name} has wrong type - {type(c[name])} vs {val_type}"
|
), f" [!] {name} has wrong type - {type(c[name])} vs {val_type}"
|
||||||
|
|
||||||
|
|
||||||
def style_wav_uri_to_dict(style_wav: str) -> Union[str, dict]:
|
|
||||||
"""Transform an uri style_wav, in either a string (path to wav file to be use for style transfer)
|
|
||||||
or a dict (gst tokens/values to be use for styling)
|
|
||||||
|
|
||||||
Args:
|
|
||||||
style_wav (str): uri
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Union[str, dict]: path to file (str) or gst style (dict)
|
|
||||||
"""
|
|
||||||
if os.path.isfile(style_wav) and style_wav.endswith(".wav"):
|
|
||||||
return style_wav # style_wav is a .wav file located on the server
|
|
||||||
|
|
||||||
style_wav = json.loads(style_wav)
|
|
||||||
return style_wav # style_wav is a gst dictionary with {token1_id : token1_weigth, ...}
|
|
||||||
|
|
Loading…
Reference in New Issue