Spaces:
Running
on
A10G
Running
on
A10G
Fix empty-text-is-given error when text contains \n
Browse files
app.py
CHANGED
@@ -192,6 +192,7 @@ def make_prompt(name, wav, sr, save=True):
|
|
192 |
|
193 |
@torch.no_grad()
|
194 |
def infer_from_audio(text, language, accent, audio_prompt, record_audio_prompt, transcript_content):
|
|
|
195 |
if len(text) > 150:
|
196 |
return "Rejected, Text too long (should be less than 150 characters)", None
|
197 |
audio_prompt = audio_prompt if audio_prompt is not None else record_audio_prompt
|
@@ -268,6 +269,7 @@ def infer_from_audio(text, language, accent, audio_prompt, record_audio_prompt,
|
|
268 |
|
269 |
@torch.no_grad()
|
270 |
def infer_from_prompt(text, language, accent, preset_prompt, prompt_file):
|
|
|
271 |
if len(text) > 150:
|
272 |
return "Rejected, Text too long (should be less than 150 characters)", None
|
273 |
clear_prompts()
|
|
|
192 |
|
193 |
@torch.no_grad()
|
194 |
def infer_from_audio(text, language, accent, audio_prompt, record_audio_prompt, transcript_content):
|
195 |
+
text = text.replace("\n", "")
|
196 |
if len(text) > 150:
|
197 |
return "Rejected, Text too long (should be less than 150 characters)", None
|
198 |
audio_prompt = audio_prompt if audio_prompt is not None else record_audio_prompt
|
|
|
269 |
|
270 |
@torch.no_grad()
|
271 |
def infer_from_prompt(text, language, accent, preset_prompt, prompt_file):
|
272 |
+
text = text.replace("\n", "")
|
273 |
if len(text) > 150:
|
274 |
return "Rejected, Text too long (should be less than 150 characters)", None
|
275 |
clear_prompts()
|