mirror of
https://github.com/svc-develop-team/so-vits-svc.git
synced 2025-01-08 11:57:43 +08:00
ruff fix
This commit is contained in:
parent
245ce55708
commit
2f8c63b875
@ -1,10 +1,10 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import random
|
import random
|
||||||
|
import sys
|
||||||
|
|
||||||
import edge_tts
|
import edge_tts
|
||||||
from edge_tts import VoicesManager
|
from edge_tts import VoicesManager
|
||||||
import sys
|
from langdetect import DetectorFactory, detect
|
||||||
from langdetect import detect
|
|
||||||
from langdetect import DetectorFactory
|
|
||||||
|
|
||||||
DetectorFactory.seed = 0
|
DetectorFactory.seed = 0
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ print(f"Text: {TEXT}, Language: {LANG}, Gender: {GENDER}, Rate: {RATE}, Volume:
|
|||||||
|
|
||||||
async def _main() -> None:
|
async def _main() -> None:
|
||||||
voices = await VoicesManager.create()
|
voices = await VoicesManager.create()
|
||||||
if not GENDER is None:
|
if GENDER is not None:
|
||||||
# From "zh-cn" to "zh-CN" etc.
|
# From "zh-cn" to "zh-CN" etc.
|
||||||
if LANG == "zh-cn" or LANG == "zh-tw":
|
if LANG == "zh-cn" or LANG == "zh-tw":
|
||||||
LOCALE = LANG[:-2] + LANG[-2:].upper()
|
LOCALE = LANG[:-2] + LANG[-2:].upper()
|
||||||
|
7
webUI.py
7
webUI.py
@ -5,23 +5,20 @@ import re
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
# os.system("wget -P cvec/ https://huggingface.co/spaces/innnky/nanami/resolve/main/checkpoint_best_legacy_500.pt")
|
# os.system("wget -P cvec/ https://huggingface.co/spaces/innnky/nanami/resolve/main/checkpoint_best_legacy_500.pt")
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
import gradio.processing_utils as gr_pu
|
|
||||||
import librosa
|
import librosa
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import soundfile
|
import soundfile
|
||||||
import torch
|
import torch
|
||||||
from scipy.io import wavfile
|
|
||||||
|
|
||||||
from compress_model import removeOptimizer
|
from compress_model import removeOptimizer
|
||||||
|
from edgetts.tts_voices import SUPPORTED_LANGUAGES
|
||||||
from inference.infer_tool import Svc
|
from inference.infer_tool import Svc
|
||||||
from utils import mix_model
|
from utils import mix_model
|
||||||
from edgetts.tts_voices import SUPPORTED_LANGUAGES
|
|
||||||
|
|
||||||
logging.getLogger('numba').setLevel(logging.WARNING)
|
logging.getLogger('numba').setLevel(logging.WARNING)
|
||||||
logging.getLogger('markdown_it').setLevel(logging.WARNING)
|
logging.getLogger('markdown_it').setLevel(logging.WARNING)
|
||||||
@ -228,7 +225,7 @@ def vc_fn2(_text, _lang, _gender, _rate, _volume, sid, output_format, vc_transfo
|
|||||||
os.remove("tts.wav")
|
os.remove("tts.wav")
|
||||||
return "Success", output_file_path
|
return "Success", output_file_path
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if debug: traceback.print_exc()
|
if debug: traceback.print_exc() # noqa: E701
|
||||||
raise gr.Error(e)
|
raise gr.Error(e)
|
||||||
|
|
||||||
def model_compression(_model):
|
def model_compression(_model):
|
||||||
|
Loading…
Reference in New Issue
Block a user