Spaces:
Running
on
Zero
Running
on
Zero
kevinwang676
commited on
Commit
•
e39a748
1
Parent(s):
4a905e2
Update GPT_SoVITS/app.py
Browse files- GPT_SoVITS/app.py +4 -0
GPT_SoVITS/app.py
CHANGED
@@ -21,6 +21,8 @@ import LangSegment, os, re, sys, json
|
|
21 |
import pdb
|
22 |
import torch
|
23 |
|
|
|
|
|
24 |
version=os.environ.get("version","v2")
|
25 |
pretrained_sovits_name=["GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2G2333k.pth", "GPT_SoVITS/pretrained_models/s2G488k.pth"]
|
26 |
pretrained_gpt_name=["GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt", "GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt"]
|
@@ -389,6 +391,8 @@ def merge_short_text_in_array(texts, threshold):
|
|
389 |
##ref_wav_path+prompt_text+prompt_language+text(单个)+text_language+top_k+top_p+temperature
|
390 |
# cache_tokens={}#暂未实现清理机制
|
391 |
cache= {}
|
|
|
|
|
392 |
def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language, how_to_cut=i18n("不切"), top_k=20, top_p=0.6, temperature=0.6, ref_free = False,speed=1,if_freeze=False,inp_refs=123):
|
393 |
global cache
|
394 |
if ref_wav_path:pass
|
|
|
21 |
import pdb
|
22 |
import torch
|
23 |
|
24 |
+
import spaces
|
25 |
+
|
26 |
version=os.environ.get("version","v2")
|
27 |
pretrained_sovits_name=["GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s2G2333k.pth", "GPT_SoVITS/pretrained_models/s2G488k.pth"]
|
28 |
pretrained_gpt_name=["GPT_SoVITS/pretrained_models/gsv-v2final-pretrained/s1bert25hz-5kh-longer-epoch=12-step=369668.ckpt", "GPT_SoVITS/pretrained_models/s1bert25hz-2kh-longer-epoch=68e-step=50232.ckpt"]
|
|
|
391 |
##ref_wav_path+prompt_text+prompt_language+text(单个)+text_language+top_k+top_p+temperature
|
392 |
# cache_tokens={}#暂未实现清理机制
|
393 |
cache= {}
|
394 |
+
|
395 |
+
@spaces.GPU
|
396 |
def get_tts_wav(ref_wav_path, prompt_text, prompt_language, text, text_language, how_to_cut=i18n("不切"), top_k=20, top_p=0.6, temperature=0.6, ref_free = False,speed=1,if_freeze=False,inp_refs=123):
|
397 |
global cache
|
398 |
if ref_wav_path:pass
|