Add option to split on \n. Add .ass output
#1
by
DEVMAXXING
- opened
This PR enables:
- Users to be able to paste text that's already separated with new lines without having to manually insert '|' separators
- Users to be able to copy the raw .ass output (for example to save and import into video editing software)
Thank you for your PR!
I would like to request some small changes:
- Currently if you try to run
python app.py
(even if you don’t have nemo or gradio installed), you will get an error about indentation. Please make sure the changes use the same spacing (tabs) as the rest of the code. - Please move these lines:
# split text on new lines if requested
if split_on_newline:
text = "|".join(list(filter(None, text.split("\n"))))
to before the lines:
data = {
"audio_filepath": audio_path,
"text": text,
}
- Please adjust the label of the new output Textbox so it’s more understandable for a general audience:
label="output subtitle file (ASS format)"
. - Currently, the ASS Textbox is visible before the user clicks submit. Let’s change that.
4a. Please update the initial ASS Textbox to not be visible at the start:ass_out = gr.Textbox(label="output subtitle file (ASS format)", visible=False)
4b. Please also update the return statement of the align function so that it will make the textbox visible once an alignment is ready:
return output_video_filepath, gr.update(value=output_info, visible=True), output_video_filepath, gr.update(value=ass_text, visible=True)
- (Optional) some general users might find the ASS Textbox confusing. Perhaps we should add another Checkbox which will determine whether the ASS Textbox gets shown or not.