Spaces:
Runtime error
Runtime error
Commit
·
795974e
1
Parent(s):
227ed9e
minor fixes
Browse files- adjust.py +2 -3
- app.py +1 -1
- file_name.py +0 -1
adjust.py
CHANGED
@@ -101,8 +101,7 @@ def get_speakers_previous(to_name):
|
|
101 |
return get_current()
|
102 |
|
103 |
|
104 |
-
def start_adjust(to_name, progress=gr.Progress()):
|
105 |
-
global current_input_file
|
106 |
change_name(to_name)
|
107 |
|
108 |
# Replacing texts
|
@@ -117,7 +116,7 @@ def start_adjust(to_name, progress=gr.Progress()):
|
|
117 |
# Adding subtitle to video
|
118 |
progress(0.8, desc=ui_lang["progress_add_subtitle"])
|
119 |
add_subtitle_to_video(
|
120 |
-
|
121 |
|
122 |
# Return video file link, transcribe string, transcribe.txt, subtitle.txt
|
123 |
transcribe_txt_list, _ = utils.read_transcribe_subtitle_file(True)
|
|
|
101 |
return get_current()
|
102 |
|
103 |
|
104 |
+
def start_adjust(input_file, to_name, progress=gr.Progress()):
|
|
|
105 |
change_name(to_name)
|
106 |
|
107 |
# Replacing texts
|
|
|
116 |
# Adding subtitle to video
|
117 |
progress(0.8, desc=ui_lang["progress_add_subtitle"])
|
118 |
add_subtitle_to_video(
|
119 |
+
input_file, get_subtitle_adjusted_file(), get_video_subtitle_file(), start_time_for_adjustment, end_time_for_adjustment)
|
120 |
|
121 |
# Return video file link, transcribe string, transcribe.txt, subtitle.txt
|
122 |
transcribe_txt_list, _ = utils.read_transcribe_subtitle_file(True)
|
app.py
CHANGED
@@ -52,7 +52,7 @@ with gr.Blocks() as demo:
|
|
52 |
adjust_speaker, adjust_audio])
|
53 |
|
54 |
adjust_button.render()
|
55 |
-
adjust_button.click(start_adjust, inputs=[adjust_speaker], outputs=[
|
56 |
output_video, output_transcribe, output_file])
|
57 |
|
58 |
with gr.Accordion("Copyright"):
|
|
|
52 |
adjust_speaker, adjust_audio])
|
53 |
|
54 |
adjust_button.render()
|
55 |
+
adjust_button.click(start_adjust, inputs=[input_video, adjust_speaker], outputs=[
|
56 |
output_video, output_transcribe, output_file])
|
57 |
|
58 |
with gr.Accordion("Copyright"):
|
file_name.py
CHANGED
@@ -3,7 +3,6 @@ import os
|
|
3 |
|
4 |
current_working_directory = os.getcwd()
|
5 |
|
6 |
-
global current_input_file
|
7 |
current_input_file = ""
|
8 |
|
9 |
|
|
|
3 |
|
4 |
current_working_directory = os.getcwd()
|
5 |
|
|
|
6 |
current_input_file = ""
|
7 |
|
8 |
|