Skip to content

Commit

Permalink
spelling correction
Browse files Browse the repository at this point in the history
Corrected spelling sentance to sentence
  • Loading branch information
GOTHIC3020 authored Feb 4, 2025
1 parent 78a0329 commit 82fc918
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def download_kokoro_weights():

snapshot_path = download_kokoro_weights()

# Download the models for sentance splitting
# Download the models for sentence splitting
nltk.download('punkt')
nltk.download('punkt_tab')

Expand Down Expand Up @@ -106,22 +106,22 @@ def run(text, preview=False):

return msg_id

sentance_based = True
sentence_based = True

def set_plitting_type(method="Split by Sentance"):
def set_plitting_type(method="Split by sentence"):
"""Set the splitting method for the text.
Args:
method (str, optional): The splitting method. Defaults to "Split by Sentance".
method (str, optional): The splitting method. Defaults to "Split by sentence".
"""
global sentance_based
sentance_based = True if method == "Split by Sentance" else False
print(f'Splitting method: {"Sentance" if sentance_based else "Word"}')
global sentence_based
sentence_based = True if method == "Split by sentence" else False
print(f'Splitting method: {"sentence" if sentence_based else "Word"}')

set_plitting_type()

def split_text(text):
"""Split the text into chunks of sentances or word up to 510 token.
"""Split the text into chunks of sentences or word up to 510 token.
Args:
text (str): The text to split.
Expand All @@ -133,7 +133,7 @@ def split_text(text):
global MODEL

max_token = 510
text_parts = sent_tokenize(text) if sentance_based else text.split()
text_parts = sent_tokenize(text) if sentence_based else text.split()
current_text_parts = []
chunks = []
current_chunk_len = 0
Expand Down Expand Up @@ -221,4 +221,4 @@ def concatenate_audio_segments(segments):
return audio_segment

if __name__ == '__main__':
run("Hello, this is an example of a text for Kokoro")
run("Hello, this is an example of a text for Kokoro")

0 comments on commit 82fc918

Please sign in to comment.