Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def custom_split_text(text: str) -> list:
|
|
62 |
if '.' in chunk_words[i]:
|
63 |
split_index = i
|
64 |
break
|
65 |
-
if split_index is not None and split_index
|
66 |
# If a period is found and it’s not the last word in the chunk,
|
67 |
# adjust the chunk so it ends at that word.
|
68 |
candidate_end = start + split_index + 1
|
@@ -170,7 +170,7 @@ def index():
|
|
170 |
the raw PCM data as it arrives. This method first reads the WAV header (44 bytes)
|
171 |
then continuously pulls in PCM data, converts it to Float32, and plays it.
|
172 |
"""
|
173 |
-
return """
|
174 |
<!DOCTYPE html>
|
175 |
<html>
|
176 |
<head>
|
|
|
62 |
if '.' in chunk_words[i]:
|
63 |
split_index = i
|
64 |
break
|
65 |
+
if split_index is not None and split_index != len(chunk_words) - 1:
|
66 |
# If a period is found and it’s not the last word in the chunk,
|
67 |
# adjust the chunk so it ends at that word.
|
68 |
candidate_end = start + split_index + 1
|
|
|
170 |
the raw PCM data as it arrives. This method first reads the WAV header (44 bytes)
|
171 |
then continuously pulls in PCM data, converts it to Float32, and plays it.
|
172 |
"""
|
173 |
+
return r"""
|
174 |
<!DOCTYPE html>
|
175 |
<html>
|
176 |
<head>
|