Skip to content

Commit c26573a

Browse files
chore(format): run black on dev (#976)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 66cd749 commit c26573a

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

ChatTTS/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def _load(
289289
use_flash_attn=False,
290290
use_vllm=False,
291291
experimental: bool = False,
292-
enable_cache = True,
292+
enable_cache=True,
293293
):
294294
if device is None:
295295
device = select_device(experimental=experimental)

ChatTTS/model/gpt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ def _prepare_generation_inputs(
231231
and attention_mask is not None
232232
and cache_length + input_ids.shape[1] > max_cache_length
233233
):
234-
attention_mask = attention_mask.narrow(1, -max_cache_length, max_cache_length)
234+
attention_mask = attention_mask.narrow(
235+
1, -max_cache_length, max_cache_length
236+
)
235237

236238
if attention_mask is not None and position_ids is None:
237239
# create position_ids on the fly for batch generation

examples/web/funcs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ def on_audio_seed_change(audio_seed_input):
6262
return rand_spk
6363

6464

65-
def load_chat(cust_path: Optional[str], coef: Optional[str], enable_cache = True) -> bool:
65+
def load_chat(cust_path: Optional[str], coef: Optional[str], enable_cache=True) -> bool:
6666
if cust_path == None:
6767
ret = chat.load(coef=coef, enable_cache=enable_cache)
6868
else:
6969
logger.info("local model path: %s", cust_path)
70-
ret = chat.load("custom", custom_path=cust_path, coef=coef, enable_cache=enable_cache)
70+
ret = chat.load(
71+
"custom", custom_path=cust_path, coef=coef, enable_cache=enable_cache
72+
)
7173
global custom_path
7274
custom_path = cust_path
7375
if ret:

examples/web/webui.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ def make_audio(autoplay, stream):
261261
parser.add_argument("--root_path", type=str, help="root path")
262262
parser.add_argument("--custom_path", type=str, help="custom model path")
263263
parser.add_argument("--coef", type=str, help="custom dvae coefficient")
264-
parser.add_argument("--disable_cache", action="store_true", help="enable model cache")
264+
parser.add_argument(
265+
"--disable_cache", action="store_true", help="enable model cache"
266+
)
265267
args = parser.parse_args()
266268

267269
logger.info("loading ChatTTS model...")

0 commit comments

Comments
 (0)