Spaces:
Runtime error
Runtime error
StormblessedKal
commited on
Commit
•
fc16268
1
Parent(s):
bb029fa
debug
Browse files- src/se_extractor.py +3 -2
src/se_extractor.py
CHANGED
@@ -13,6 +13,7 @@ model_size = 'medium'
|
|
13 |
def split_audio_whisper(audio_path, target_dir='processed',needs_offset=True):
|
14 |
print("in whisper split")
|
15 |
model = WhisperModel('medium', device="cuda", compute_type="float16")
|
|
|
16 |
audio = AudioSegment.from_file(audio_path)
|
17 |
max_len = len(audio)
|
18 |
|
@@ -21,7 +22,7 @@ def split_audio_whisper(audio_path, target_dir='processed',needs_offset=True):
|
|
21 |
|
22 |
segments, info = model.transcribe(audio_path, beam_size=5, word_timestamps=True)
|
23 |
segments = list(segments)
|
24 |
-
|
25 |
# create directory
|
26 |
os.makedirs(target_folder, exist_ok=True)
|
27 |
wavs_folder = os.path.join(target_folder, 'wavs')
|
@@ -134,7 +135,7 @@ def get_se(audio_path, vc_model, target_dir='processed', vad=True):
|
|
134 |
wavs_folder = split_audio_vad(audio_path, target_dir)
|
135 |
else:
|
136 |
wavs_folder = split_audio_whisper(audio_path, target_dir)
|
137 |
-
|
138 |
audio_segs = glob(f'{wavs_folder}/*.wav')
|
139 |
if len(audio_segs) == 0:
|
140 |
raise NotImplementedError('No audio segments found!')
|
|
|
13 |
def split_audio_whisper(audio_path, target_dir='processed',needs_offset=True):
|
14 |
print("in whisper split")
|
15 |
model = WhisperModel('medium', device="cuda", compute_type="float16")
|
16 |
+
print("loaded")
|
17 |
audio = AudioSegment.from_file(audio_path)
|
18 |
max_len = len(audio)
|
19 |
|
|
|
22 |
|
23 |
segments, info = model.transcribe(audio_path, beam_size=5, word_timestamps=True)
|
24 |
segments = list(segments)
|
25 |
+
print(segments)
|
26 |
# create directory
|
27 |
os.makedirs(target_folder, exist_ok=True)
|
28 |
wavs_folder = os.path.join(target_folder, 'wavs')
|
|
|
135 |
wavs_folder = split_audio_vad(audio_path, target_dir)
|
136 |
else:
|
137 |
wavs_folder = split_audio_whisper(audio_path, target_dir)
|
138 |
+
print("Done")
|
139 |
audio_segs = glob(f'{wavs_folder}/*.wav')
|
140 |
if len(audio_segs) == 0:
|
141 |
raise NotImplementedError('No audio segments found!')
|