Skip to content

Commit 9d7c437

Browse files
committed
doc: add vLLM instruction
1 parent a9af30b commit 9d7c437

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

ChatTTS/model/gpt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import gc
66
from pathlib import Path
77

8-
from safetensors.torch import save_file
98
import torch
109
import torch.nn as nn
1110
import torch.nn.functional as F
@@ -92,6 +91,8 @@ def __init__(
9291

9392
def from_pretrained(self, file_path: str):
9493
if self.is_vllm and platform.system().lower() == "linux":
94+
from safetensors.torch import save_file
95+
9596
from .velocity.llm import LLM
9697
from .velocity.post_model import PostModel
9798

@@ -104,7 +105,7 @@ def from_pretrained(self, file_path: str):
104105
gpt.gpt.save_pretrained(vllm_folder / "gpt")
105106
post_model = (
106107
PostModel(
107-
int(self.gpt.config.hidden_size),
108+
int(gpt.gpt.config.hidden_size),
108109
self.num_audio_tokens,
109110
self.num_text_tokens,
110111
)

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ conda activate chattts
101101
pip install -r requirements.txt
102102
```
103103

104-
#### Optional: Install TransformerEngine if using NVIDIA GPU (Linux only)
104+
#### Optional: Install vLLM (Linux only)
105+
```bash
106+
pip install safetensors vllm==0.2.7 torchaudio
107+
```
108+
109+
#### Unrecommended Optional: Install TransformerEngine if using NVIDIA GPU (Linux only)
105110
> [!Note]
106111
> The installation process is very slow.
107112
@@ -113,7 +118,7 @@ pip install -r requirements.txt
113118
pip install git+https://github.com/NVIDIA/TransformerEngine.git@stable
114119
```
115120

116-
#### Optional: Install FlashAttention-2 (mainly NVIDIA GPU)
121+
#### Unrecommended Optional: Install FlashAttention-2 (mainly NVIDIA GPU)
117122
> [!Note]
118123
> See supported devices at the [Hugging Face Doc](https://huggingface.co/docs/transformers/perf_infer_gpu_one#flashattention-2).
119124

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@ WeTextProcessing; sys_platform == 'linux'
1414
nemo_text_processing; sys_platform == 'linux'
1515
av
1616
pydub
17-
safetensors
18-
vllm>=0.2.7; sys_platform == 'linux'

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"transformers>=4.41.1",
2929
"vector_quantize_pytorch",
3030
"vocos",
31-
"safetensors",
3231
],
3332
platforms="any",
3433
classifiers=[

0 commit comments

Comments
 (0)