Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from utilities.setup import get_files
|
3 |
-
#
|
4 |
-
|
5 |
|
6 |
#@spaces.GPU
|
7 |
def process_meeting(audio_input, num_speakers, speaker_names):
|
@@ -12,19 +12,14 @@ def process_meeting(audio_input, num_speakers, speaker_names):
|
|
12 |
"""
|
13 |
|
14 |
# first, pass it through a diarization stage.
|
15 |
-
|
16 |
# Next, pass it through a transctiption stage
|
17 |
|
18 |
# After, match the diarization with the transcription
|
19 |
|
20 |
# Finally, Clean up the docs.
|
21 |
|
22 |
-
|
23 |
-
if 1 < num_speakers < 6:
|
24 |
-
answer = "Completed Loading Data", "fl"
|
25 |
-
else:
|
26 |
-
answer = "Number of speakers out of range", "fl"
|
27 |
-
return answer
|
28 |
|
29 |
|
30 |
|
@@ -78,5 +73,9 @@ def main(conf):
|
|
78 |
|
79 |
|
80 |
if __name__ == "__main__":
|
|
|
81 |
conf = get_files.json_cfg()
|
|
|
|
|
|
|
82 |
main(conf)
|
|
|
1 |
import gradio as gr
|
2 |
from utilities.setup import get_files
|
3 |
+
#import spaces
|
4 |
+
from services.diarization import Diarizer
|
5 |
|
6 |
#@spaces.GPU
|
7 |
def process_meeting(audio_input, num_speakers, speaker_names):
|
|
|
12 |
"""
|
13 |
|
14 |
# first, pass it through a diarization stage.
|
15 |
+
diarization_result, label_file = diarizer.run(temp_file, num_speakers)
|
16 |
# Next, pass it through a transctiption stage
|
17 |
|
18 |
# After, match the diarization with the transcription
|
19 |
|
20 |
# Finally, Clean up the docs.
|
21 |
|
22 |
+
return diarization_result, label_file
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
|
|
|
73 |
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
+
# get config
|
77 |
conf = get_files.json_cfg()
|
78 |
+
# initialize diarizer
|
79 |
+
diarizer = Diarizer(conf)
|
80 |
+
|
81 |
main(conf)
|