Merge pull request #566 from Paladinium/alltalkbeta_rvc_cache_size
Provide config setting for RVC model cache size
This commit is contained in:
4 files changed
+8
-3
No files matched your search
@@ -38,6 +38,7 @@ class AlltalkConfigRvcSettings(BaseModel):
|
||||
f0method: str = "fcpe"
|
||||
embedder_model: str = "hubert"
|
||||
training_data_size: int = 45000
|
||||
model_cache_size: int = 1
|
||||
|
||||
class AlltalkConfigTgwUi(BaseModel):
|
||||
tgwui_activate_tts: bool = True
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@
|
||||
"hop_length": 130,
|
||||
"f0method": "fcpe",
|
||||
"embedder_model": "hubert",
|
||||
"training_data_size": 45000
|
||||
"training_data_size": 45000,
|
||||
"model_cache_size": 1
|
||||
},
|
||||
"tgwui": {
|
||||
"tgwui_activate_tts": true,
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
"hop_length": $ENV.ALLTALK_RVC_HOP_LENGTH,
|
||||
"f0method": $ENV.ALLTALK_RVC_F0METHOD,
|
||||
"embedder_model": $ENV.ALLTALK_RVC_EMBEDDER_MODEL,
|
||||
"training_data_size": $ENV.ALLTALK_RVC_TRAINING_DATA_SIZE
|
||||
"training_data_size": $ENV.ALLTALK_RVC_TRAINING_DATA_SIZE,
|
||||
"model_cache_size": $ENV.ALLTALK_RVC_MODEL_CACHE_SIZE
|
||||
},
|
||||
"api_def": {
|
||||
"api_port_number": $ENV.ALLTALK_API_PORT_NUMBER,
|
||||
|
||||
@@ -9,6 +9,8 @@ import soundfile as sf
|
||||
import librosa
|
||||
from functools import lru_cache
|
||||
|
||||
from config import AlltalkConfig
|
||||
|
||||
now_dir = os.getcwd()
|
||||
sys.path.append(now_dir)
|
||||
|
||||
@@ -171,7 +173,7 @@ def voice_conversion(
|
||||
return None, None
|
||||
|
||||
|
||||
@lru_cache(maxsize=3)
|
||||
@lru_cache(maxsize=AlltalkConfig.get_instance().rvc_settings.model_cache_size)
|
||||
def get_vc(weight_root, sid, file_index=None, training_data_size=10000, debug_rvc=False):
|
||||
net_g = None
|
||||
branding="AllTalk "
|
||||
|
||||
Reference in new issue
Block a user