Spaces:
Running
on
Zero
Running
on
Zero
Anthonyg5005
commited on
Update app.py
Browse filescapitalized "warning" for gradio's warning function, as seen in [docs](https://www.gradio.app/main/docs/gradio/warning).\
should fix the attribute error when using text over 300 characters, don't have hardware or hf pro to test though.\
could also potentially use gr.Error to cancel the generation entirely in case the user wants to change the text to something smaller.
app.py
CHANGED
@@ -73,7 +73,7 @@ def infer(sample_audio_path, target_text, progress=gr.Progress()):
|
|
73 |
if len(target_text) == 0:
|
74 |
return None
|
75 |
elif len(target_text) > 300:
|
76 |
-
gr.
|
77 |
target_text = target_text[:300]
|
78 |
|
79 |
input_text = prompt_text + ' ' + target_text
|
|
|
73 |
if len(target_text) == 0:
|
74 |
return None
|
75 |
elif len(target_text) > 300:
|
76 |
+
gr.Warning("Text is too long. Please keep it under 300 characters.")
|
77 |
target_text = target_text[:300]
|
78 |
|
79 |
input_text = prompt_text + ' ' + target_text
|