Skip to content

Commit

Permalink
chore(format): run black on dev (#719)
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] committed Aug 25, 2024
1 parent 2d8fde1 commit 9f9abec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChatTTS/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class GPT:
num_text_tokens: int = 21178
num_vq: int = 4


@dataclass(repr=False, eq=False)
class Embed:
hidden_size: int = 768
Expand Down
8 changes: 6 additions & 2 deletions ChatTTS/model/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def __init__(
self.head_text = embed.head_text.__call__
self.head_code = [hc.__call__ for hc in embed.head_code]

def from_pretrained(self, gpt_folder: str, embed_file_path: str, experimental=False):
def from_pretrained(
self, gpt_folder: str, embed_file_path: str, experimental=False
):
if self.is_vllm and platform.system().lower() == "linux":

from .velocity import LLM
Expand All @@ -70,7 +72,9 @@ def from_pretrained(self, gpt_folder: str, embed_file_path: str, experimental=Fa
self.logger.info("vLLM model loaded")
return

self.gpt: LlamaModel = LlamaModel.from_pretrained(gpt_folder).to(self.device_gpt)
self.gpt: LlamaModel = LlamaModel.from_pretrained(gpt_folder).to(
self.device_gpt
)
del self.gpt.embed_tokens

if (
Expand Down
1 change: 1 addition & 0 deletions ChatTTS/model/velocity/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from ..embed import Embed


class Sampler:
def __init__(self, post_model: Embed, num_audio_tokens: int, num_vq: int):
self.post_model = post_model
Expand Down

0 comments on commit 9f9abec

Please sign in to comment.