Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add experimental argument #682

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ChatTTS/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def load(
coef: Optional[torch.Tensor] = None,
use_flash_attn=False,
use_vllm=False,
experimental: bool = False,
) -> bool:
download_path = self.download_models(source, force_redownload, custom_path)
if download_path is None:
Expand All @@ -137,6 +138,7 @@ def load(
coef=coef,
use_flash_attn=use_flash_attn,
use_vllm=use_vllm,
experimental=experimental,
**{
k: os.path.join(download_path, v)
for k, v in asdict(self.config.path).items()
Expand Down Expand Up @@ -233,9 +235,10 @@ def _load(
coef: Optional[str] = None,
use_flash_attn=False,
use_vllm=False,
experimental: bool = False,
):
if device is None:
device = select_device()
device = select_device(experimental=experimental)
self.logger.info("use device %s", str(device))
self.device = device
self.device_gpt = device if "mps" not in str(device) else torch.device("cpu")
Expand Down Expand Up @@ -287,7 +290,7 @@ def _load(
logger=self.logger,
).eval()
assert gpt_ckpt_path, "gpt_ckpt_path should not be None"
gpt.from_pretrained(gpt_ckpt_path)
gpt.from_pretrained(gpt_ckpt_path, experimental=experimental)
gpt.prepare(compile=compile and "cuda" in str(device))
self.gpt = gpt

Expand Down
Loading