feat: Add FAISS index support and Conrad base voice in preview generator
This commit is contained in:
1 parent
ad09dc3512
commit
07752f75d7
1 file changed
+13
-17
+13
-17
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Force CPU inference for the preview so GPU training isn't disturbed or OOMed
|
||||
# Force CPU inference for preview to prevent GPU VRAM collision with training
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
|
||||
|
||||
applio_dir = r"C:\GitHub\VocoLoom\Applio"
|
||||
@@ -11,16 +11,13 @@ os.chdir(applio_dir)
|
||||
from core import run_tts_script
|
||||
|
||||
log_dir = os.path.join(applio_dir, "logs", "Juergen_Seiferth")
|
||||
index_path = os.path.join(log_dir, "Juergen_Seiferth.index")
|
||||
|
||||
pth_candidates = [
|
||||
f for f in os.listdir(log_dir)
|
||||
if f.startswith("Juergen_Seiferth_") and f.endswith(".pth")
|
||||
]
|
||||
|
||||
if not pth_candidates:
|
||||
print("No checkpoints found!")
|
||||
sys.exit(1)
|
||||
|
||||
# Sort by epoch number
|
||||
def get_epoch(fn):
|
||||
try:
|
||||
parts = fn.split("_")
|
||||
@@ -34,32 +31,31 @@ def get_epoch(fn):
|
||||
pth_candidates.sort(key=get_epoch)
|
||||
latest_checkpoint = pth_candidates[-1]
|
||||
latest_pth = os.path.join(log_dir, latest_checkpoint)
|
||||
print(f"Using checkpoint: {latest_checkpoint} ({latest_pth})")
|
||||
print(f"Using checkpoint: {latest_checkpoint}")
|
||||
print(f"Using index: {index_path} (exists: {os.path.exists(index_path)})")
|
||||
|
||||
text = (
|
||||
"Pass mal auf! Was nicht ganz läuft so wie ich das will, das wird so gemacht, damit das läuft! "
|
||||
"Fertig Ballett oder was?! Hauptsache angekommen, stimmt's?!"
|
||||
)
|
||||
output_tts = r"C:\GitHub\VocoLoom\tts_base.wav"
|
||||
output_rvc = r"C:\GitHub\VocoLoom\juergen_preview_" + latest_checkpoint.replace(".pth", ".wav")
|
||||
|
||||
print(f"Generating base TTS with edge-tts ('de-DE-KillianNeural')...")
|
||||
print(f"Target text: {text}")
|
||||
output_tts = r"C:\GitHub\VocoLoom\tts_conrad.wav"
|
||||
output_rvc = r"C:\GitHub\VocoLoom\juergen_conrad_index85_" + latest_checkpoint.replace(".pth", ".wav")
|
||||
|
||||
res = run_tts_script(
|
||||
tts_file="",
|
||||
tts_text=text,
|
||||
tts_voice="de-DE-KillianNeural",
|
||||
tts_voice="de-DE-ConradNeural",
|
||||
tts_rate=0,
|
||||
pitch=0,
|
||||
index_rate=0.0,
|
||||
pitch=-2,
|
||||
index_rate=0.85,
|
||||
volume_envelope=1.0,
|
||||
protect=0.33,
|
||||
f0_method="rmvpe",
|
||||
output_tts_path=output_tts,
|
||||
output_rvc_path=output_rvc,
|
||||
pth_path=latest_pth,
|
||||
index_path="",
|
||||
index_path=index_path if os.path.exists(index_path) else "",
|
||||
f0_autotune=False,
|
||||
f0_autotune_strength=1.0,
|
||||
proposed_pitch=False,
|
||||
@@ -75,5 +71,5 @@ res = run_tts_script(
|
||||
cleanup_strength=12,
|
||||
)
|
||||
|
||||
print(f"Generated preview audio at: {output_rvc}")
|
||||
print(f"Result details: {res}")
|
||||
print(f"Generated: {output_rvc}")
|
||||
print(f"Details: {res}")
|
||||
Reference in new issue
Block a user