Skip to content

Commit 6843c53

Browse files
authored
ruff v0.9.0 implements the stable format for 2025 (#73)
1 parent 1b3ae01 commit 6843c53

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/kokoro_onnx/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ def _create_audio(
8282
phonemes = phonemes[:MAX_PHONEME_LENGTH]
8383
start_t = time.time()
8484
tokens = self.tokenizer.tokenize(phonemes)
85-
assert (
86-
len(tokens) <= MAX_PHONEME_LENGTH
87-
), f"Context length is {MAX_PHONEME_LENGTH}, but leave room for the pad token 0 at the start & end"
85+
assert len(tokens) <= MAX_PHONEME_LENGTH, (
86+
f"Context length is {MAX_PHONEME_LENGTH}, but leave room for the pad token 0 at the start & end"
87+
)
8888

8989
voice = voice[len(tokens)]
9090
tokens = [[0, *tokens, 0]]
@@ -152,9 +152,9 @@ def create(
152152
Create audio from text using the specified voice and speed.
153153
"""
154154

155-
assert (
156-
lang in SUPPORTED_LANGUAGES
157-
), f"Language must be either {', '.join(SUPPORTED_LANGUAGES)}. Got {lang}"
155+
assert lang in SUPPORTED_LANGUAGES, (
156+
f"Language must be either {', '.join(SUPPORTED_LANGUAGES)}. Got {lang}"
157+
)
158158
assert speed >= 0.5 and speed <= 2.0, "Speed should be between 0.5 and 2.0"
159159

160160
if isinstance(voice, str):
@@ -194,9 +194,9 @@ async def create_stream(
194194
"""
195195
Stream audio creation asynchronously in the background, yielding chunks as they are processed.
196196
"""
197-
assert (
198-
lang in SUPPORTED_LANGUAGES
199-
), f"Language must be either {', '.join(SUPPORTED_LANGUAGES)}. Got {lang}"
197+
assert lang in SUPPORTED_LANGUAGES, (
198+
f"Language must be either {', '.join(SUPPORTED_LANGUAGES)}. Got {lang}"
199+
)
200200
assert speed >= 0.5 and speed <= 2.0, "Speed should be between 0.5 and 2.0"
201201

202202
if isinstance(voice, str):

0 commit comments

Comments
 (0)