diff --git a/voice_conversion/so-vits-svc-paul-v2/src/fakeyou_infer.py b/voice_conversion/so-vits-svc-paul-v2/src/fakeyou_infer.py index f4a4015..4cd890b 100644 --- a/voice_conversion/so-vits-svc-paul-v2/src/fakeyou_infer.py +++ b/voice_conversion/so-vits-svc-paul-v2/src/fakeyou_infer.py @@ -184,6 +184,12 @@ def cli(): @click.option( "-ab", "--absolute-thresh", type=bool, default=False, help="absolute thresh" ) +@click.option( + "--hacky-fix", + type=bool, + default=False, + help="activate hacky fixes for FakeYou job runner" +) def infer( input_path: Path, output_path: Path, @@ -201,6 +207,7 @@ def infer( chunk_seconds: float = 0.5, absolute_thresh: bool = False, device: Literal["cpu", "cuda"] = "cuda" if torch.cuda.is_available() else "cpu", + hacky_fix: bool = False, ): """Inference""" #from .inference_main import infer @@ -211,6 +218,15 @@ def infer( LOG.warning(f"f0 method: {f0_method}") LOG.warning(f"transpose: {transpose}") + if hacky_fix: + # NB(bt,2023-05-23): Not sure why so-vits-svc is taking minutes to run. + # Maybe this helps? + print('torch.cuda.empty_cache() ...') + torch.cuda.empty_cache() + print('torch._C._jit_set_profiling_mode(False) ...') + torch._C._jit_set_profiling_mode(False) + print('continuing ...') + from so_vits_svc_fork.inference.main import infer if not auto_predict_f0: diff --git a/voice_conversion/so-vits-svc-paul-v2/src/so_vits_svc_fork/utils.py b/voice_conversion/so-vits-svc-paul-v2/src/so_vits_svc_fork/utils.py index 0e2e3dd..6340c0b 100644 --- a/voice_conversion/so-vits-svc-paul-v2/src/so_vits_svc_fork/utils.py +++ b/voice_conversion/so-vits-svc-paul-v2/src/so_vits_svc_fork/utils.py @@ -156,7 +156,7 @@ class HubertModelWithFinalProj(HubertModel): def get_hubert_model( device: str | torch.device, final_proj: bool = True ) -> HubertModel: - LOG.info("get_hubert_model()") + LOG.info(f"get_hubert_model() for device = {device}") if final_proj: return HubertModelWithFinalProj.from_pretrained( "lengyue233/content-vec-best"