cnph001 commited on
Commit
f067030
·
verified ·
1 Parent(s): 3e534e0

Update app.py

Browse files

Update to recognise all thre quote mark
# Split the text using straight quotes (") and curly quotes (“ and ”)
paragraphs = [p.strip() for p in re.split(r'[“”"]', text) if p.strip()]

Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -130,7 +130,9 @@ async def text_to_speech(text, voice, rate, pitch):
130
  if not voice:
131
  return None, gr.Warning("Please select a voice.")
132
 
133
- paragraphs = [p.strip() for p in re.split(r'"', text) if p.strip()]
 
 
134
  final_audio_segments = []
135
 
136
  for paragraph in paragraphs:
 
130
  if not voice:
131
  return None, gr.Warning("Please select a voice.")
132
 
133
+ #paragraphs = [p.strip() for p in re.split(r'"', text) if p.strip()]
134
+ # Split the text using straight quotes (") and curly quotes (“ and ”)
135
+ paragraphs = [p.strip() for p in re.split(r'[“”"]', text) if p.strip()]
136
  final_audio_segments = []
137
 
138
  for paragraph in paragraphs: