save_config_bark.py 710 B

1234567891011121314151617181920212223242526
  1. from tts_webui.config.config import config
  2. from tts_webui.config._save_config import _save_config
  3. def save_config_bark(
  4. text_use_gpu: bool,
  5. text_use_small: bool,
  6. coarse_use_gpu: bool,
  7. coarse_use_small: bool,
  8. fine_use_gpu: bool,
  9. fine_use_small: bool,
  10. codec_use_gpu: bool,
  11. ):
  12. global config
  13. config["model"] = {
  14. "text_use_gpu": text_use_gpu,
  15. "text_use_small": text_use_small,
  16. "coarse_use_gpu": coarse_use_gpu,
  17. "coarse_use_small": coarse_use_small,
  18. "fine_use_gpu": fine_use_gpu,
  19. "fine_use_small": fine_use_small,
  20. "codec_use_gpu": codec_use_gpu,
  21. }
  22. _save_config(config)
  23. return f"Saved: {str(config['model'])}"