Skip to content

Commit

Permalink
doc: restrict TE to linux only
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jun 29, 2024
1 parent d7ef876 commit 3a8f908
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
21 changes: 3 additions & 18 deletions ChatTTS/model/gpt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
import os, platform

os.environ["TOKENIZERS_PARALLELISM"] = "false"
"""
Expand All @@ -24,21 +24,6 @@
from ..utils import del_all


"""class LlamaMLP(nn.Module):
def __init__(self, hidden_size, intermediate_size):
super().__init__()
self.hidden_size = hidden_size
self.intermediate_size = intermediate_size
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
self.act_fn = F.silu
def forward(self, x):
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
return down_proj"""


class GPT(nn.Module):
def __init__(
self,
Expand Down Expand Up @@ -115,12 +100,12 @@ def _build_llama(
llama_config = LlamaConfig(**config)

model = None
if "cuda" in str(device):
if "cuda" in str(device) and platform.system().lower() == "linux":
try:
from .cuda import TELlamaModel

model = TELlamaModel(llama_config)
self.logger.info("use NVIDIA accelerated TELlamaModel")
self.logger.info("Linux with CUDA, try NVIDIA accelerated TELlamaModel")
except Exception as e:
model = None
self.logger.warn(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ conda activate chattts
pip install -r requirements.txt
```

#### Optional: Install TransformerEngine if using NVIDIA GPU
#### Optional: Install TransformerEngine if using NVIDIA GPU (Linux only)
> [!Note]
> The installation process is very slow.
Expand Down

0 comments on commit 3a8f908

Please sign in to comment.