Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ from utilities.setup import get_files
|
|
3 |
#import spaces
|
4 |
from services.diarization import Diarizer
|
5 |
from services.asr import Transcriber
|
|
|
|
|
6 |
|
7 |
#@spaces.GPU
|
8 |
def process_meeting(audio_input, num_speakers, speaker_names):
|
@@ -14,14 +16,20 @@ def process_meeting(audio_input, num_speakers, speaker_names):
|
|
14 |
|
15 |
print(audio_input)
|
16 |
# first, pass it through a diarization stage.
|
17 |
-
|
|
|
18 |
# Next, pass it through a transctiption stage
|
19 |
-
transcriber.
|
20 |
# After, match the diarization with the transcription
|
21 |
-
|
|
|
|
|
|
|
|
|
22 |
# Finally, Clean up the docs.
|
23 |
-
|
24 |
-
|
|
|
25 |
|
26 |
|
27 |
|
|
|
3 |
#import spaces
|
4 |
from services.diarization import Diarizer
|
5 |
from services.asr import Transcriber
|
6 |
+
from speechbox import ASRDiarizationPipeline
|
7 |
+
|
8 |
|
9 |
#@spaces.GPU
|
10 |
def process_meeting(audio_input, num_speakers, speaker_names):
|
|
|
16 |
|
17 |
print(audio_input)
|
18 |
# first, pass it through a diarization stage.
|
19 |
+
#diarization_result, label_file = diarizer.run(audio_input, num_speakers)
|
20 |
+
diarization_pipeline = diarizer.get_pipeline()
|
21 |
# Next, pass it through a transctiption stage
|
22 |
+
asr_pipeline = transcriber.get_pipeline()
|
23 |
# After, match the diarization with the transcription
|
24 |
+
pipeline = ASRDiarizationPipeline(
|
25 |
+
asr_pipeline=asr_pipeline,
|
26 |
+
diarization_pipeline=diarization_pipeline,
|
27 |
+
diarization_num_speakers = num_speakers)
|
28 |
+
|
29 |
# Finally, Clean up the docs.
|
30 |
+
output = pipeline(audio_input)
|
31 |
+
print(output)
|
32 |
+
return "a", None #diarization_result, label_file
|
33 |
|
34 |
|
35 |
|