diff --git a/src/so_vits_svc_fork/gui.py b/src/so_vits_svc_fork/gui.py index e91f86f1..67de9058 100644 --- a/src/so_vits_svc_fork/gui.py +++ b/src/so_vits_svc_fork/gui.py @@ -9,7 +9,7 @@ import sounddevice as sd import soundfile as sf import torch -from pebble import ProcessFuture, ProcessPool +from pebble import ProcessFuture, ThreadPool from tqdm.tk import tqdm_tk from .utils import ensure_pretrained_model, get_optimal_device @@ -513,7 +513,9 @@ def apply_preset(name: str) -> None: del default_name update_speaker() update_devices() - with ProcessPool(max_workers=1) as pool: + # with ProcessPool(max_workers=1) as pool: + # with ProcessPool(max_workers=1, context="spawn") as pool: + with ThreadPool(max_workers=1) as pool: future: None | ProcessFuture = None infer_futures: set[ProcessFuture] = set() while True: @@ -673,18 +675,18 @@ def apply_preset(name: str) -> None: except Exception as e: LOG.exception(e) if future is not None and future.done(): - LOG.error("Error in realtime: ") try: future.result() except Exception as e: + LOG.error("Error in realtime: ") LOG.exception(e) future = None for future in copy(infer_futures): if future.done(): - LOG.error("Error in inference: ") try: future.result() except Exception as e: + LOG.error("Error in inference: ") LOG.exception(e) infer_futures.remove(future) if future: