Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -202,7 +202,8 @@ def transcribe_zh(audio_path):
|
|
202 |
_, segments = align_zh(segments, audio_path)
|
203 |
state = get_transcribe_state(segments)
|
204 |
success_message = "<span style='color:green;'>Success: Transcribe completed successfully!</span>"
|
205 |
-
|
|
|
206 |
return [
|
207 |
state["transcript"], state['segments'],
|
208 |
state, success_message
|
@@ -694,13 +695,13 @@ if __name__ == "__main__":
|
|
694 |
with gr.Column(scale=2):
|
695 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/84_121550_000074_000000.wav", label="Input Audio", type="filepath", interactive=True)
|
696 |
with gr.Group():
|
697 |
-
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="
|
698 |
info="Use whisperx model to get the transcript.")
|
699 |
transcribe_btn = gr.Button(value="Transcribe")
|
700 |
|
701 |
with gr.Column(scale=3):
|
702 |
with gr.Group():
|
703 |
-
transcript = gr.Textbox(label="Text", lines=7, value="
|
704 |
run_btn = gr.Button(value="Run")
|
705 |
|
706 |
with gr.Column(scale=2):
|
@@ -750,7 +751,7 @@ if __name__ == "__main__":
|
|
750 |
with gr.Column(scale=2):
|
751 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/84_121550_000074_000000.wav", label="Input Audio", type="filepath", interactive=True)
|
752 |
with gr.Group():
|
753 |
-
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="
|
754 |
info="Use whisperx model to get the transcript.")
|
755 |
transcribe_btn = gr.Button(value="Transcribe")
|
756 |
|
@@ -806,13 +807,13 @@ if __name__ == "__main__":
|
|
806 |
with gr.Column(scale=2):
|
807 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/aishell3_test.wav", label="Input Audio", type="filepath", interactive=True)
|
808 |
with gr.Group():
|
809 |
-
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="
|
810 |
info="Use whisperx model to get the transcript.")
|
811 |
transcribe_btn = gr.Button(value="Transcribe")
|
812 |
|
813 |
with gr.Column(scale=3):
|
814 |
with gr.Group():
|
815 |
-
transcript = gr.Textbox(label="Text", lines=7, value="
|
816 |
run_btn = gr.Button(value="Run")
|
817 |
|
818 |
with gr.Column(scale=2):
|
@@ -862,7 +863,7 @@ if __name__ == "__main__":
|
|
862 |
with gr.Column(scale=2):
|
863 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/aishell3_test.wav", label="Input Audio", type="filepath", interactive=True)
|
864 |
with gr.Group():
|
865 |
-
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="
|
866 |
info="Use whisperx model to get the transcript.")
|
867 |
transcribe_btn = gr.Button(value="Transcribe")
|
868 |
|
|
|
202 |
_, segments = align_zh(segments, audio_path)
|
203 |
state = get_transcribe_state(segments)
|
204 |
success_message = "<span style='color:green;'>Success: Transcribe completed successfully!</span>"
|
205 |
+
converter = opencc.OpenCC('t2s')
|
206 |
+
state["transcript"] = converter.convert(state["transcript"])
|
207 |
return [
|
208 |
state["transcript"], state['segments'],
|
209 |
state, success_message
|
|
|
695 |
with gr.Column(scale=2):
|
696 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/84_121550_000074_000000.wav", label="Input Audio", type="filepath", interactive=True)
|
697 |
with gr.Group():
|
698 |
+
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="but when I had approached so near to them the common object, which the sense deceives, lost not by distance any of its marks.",
|
699 |
info="Use whisperx model to get the transcript.")
|
700 |
transcribe_btn = gr.Button(value="Transcribe")
|
701 |
|
702 |
with gr.Column(scale=3):
|
703 |
with gr.Group():
|
704 |
+
transcript = gr.Textbox(label="Text", lines=7, value="but when I saw the mirage of the lake in the distance, which the sense deceives, lost not by distance any of its marks.", interactive=True)
|
705 |
run_btn = gr.Button(value="Run")
|
706 |
|
707 |
with gr.Column(scale=2):
|
|
|
751 |
with gr.Column(scale=2):
|
752 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/84_121550_000074_000000.wav", label="Input Audio", type="filepath", interactive=True)
|
753 |
with gr.Group():
|
754 |
+
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="but when I had approached so near to them the common object, which the sense deceives, lost not by distance any of its marks.",
|
755 |
info="Use whisperx model to get the transcript.")
|
756 |
transcribe_btn = gr.Button(value="Transcribe")
|
757 |
|
|
|
807 |
with gr.Column(scale=2):
|
808 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/aishell3_test.wav", label="Input Audio", type="filepath", interactive=True)
|
809 |
with gr.Group():
|
810 |
+
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="价格已基本都在三万到六万之间",
|
811 |
info="Use whisperx model to get the transcript.")
|
812 |
transcribe_btn = gr.Button(value="Transcribe")
|
813 |
|
814 |
with gr.Column(scale=3):
|
815 |
with gr.Group():
|
816 |
+
transcript = gr.Textbox(label="Text", lines=7, value="价格已基本都在一万到两万之间", interactive=True)
|
817 |
run_btn = gr.Button(value="Run")
|
818 |
|
819 |
with gr.Column(scale=2):
|
|
|
863 |
with gr.Column(scale=2):
|
864 |
input_audio = gr.Audio(value=f"{DEMO_PATH}/aishell3_test.wav", label="Input Audio", type="filepath", interactive=True)
|
865 |
with gr.Group():
|
866 |
+
original_transcript = gr.Textbox(label="Original transcript", lines=5, value="价格已基本都在三万到六万之间",
|
867 |
info="Use whisperx model to get the transcript.")
|
868 |
transcribe_btn = gr.Button(value="Transcribe")
|
869 |
|