Skip to content

Commit

Permalink
chore(format): run black on dev (#678)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Aug 9, 2024
1 parent 7e33889 commit 000cfcb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ChatTTS/model/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,16 @@ def from_pretrained(self, file_path: str, experimental=False):
self.load_state_dict(torch.load(file_path, weights_only=True, mmap=True))

if (
experimental and "cuda" in str(self.device_gpt) and platform.system().lower() == "linux"
experimental
and "cuda" in str(self.device_gpt)
and platform.system().lower() == "linux"
): # is TELlamaModel
try:
from .cuda import TELlamaModel

self.logger.warning("Linux with CUDA, try NVIDIA accelerated TELlamaModel because experimental is enabled")
self.logger.warning(
"Linux with CUDA, try NVIDIA accelerated TELlamaModel because experimental is enabled"
)
state_dict = self.gpt.state_dict()
vanilla = TELlamaModel.from_state_dict(state_dict, self.llama_config)
# Force mem release. Taken from huggingface code
Expand Down

0 comments on commit 000cfcb

Please sign in to comment.