Spaces:
Runtime error
Runtime error
Alexis Rodriguez
commited on
Commit
路
6e3969a
1
Parent(s):
f504fd5
updated comments
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ embedding_model = PretrainedSpeakerEmbedding(
|
|
23 |
device=torch.device("cuda" if torch.cuda.is_available() else "cpu"),
|
24 |
)
|
25 |
|
26 |
-
|
27 |
def bulk_transcribe(files, model):
|
28 |
chosen_model = whisper.load_model(model)
|
29 |
output = ""
|
@@ -42,13 +42,13 @@ def bulk_transcribe(files, model):
|
|
42 |
|
43 |
return "Transcripci贸n.txt", output
|
44 |
|
45 |
-
|
46 |
def get_file_name(file):
|
47 |
file_path = file.split("/")
|
48 |
file_name = file_path[-1]
|
49 |
return file_name
|
50 |
|
51 |
-
|
52 |
def transcribe(audio, model):
|
53 |
num_speakers = 3
|
54 |
path, error = convert_to_wav(audio)
|
@@ -103,7 +103,7 @@ audio = Audio()
|
|
103 |
|
104 |
def segment_embedding(path, segment, duration):
|
105 |
start = segment["start"]
|
106 |
-
|
107 |
end = min(duration, segment["end"])
|
108 |
clip = Segment(start, end)
|
109 |
waveform, sample_rate = audio.crop(path, clip)
|
|
|
23 |
device=torch.device("cuda" if torch.cuda.is_available() else "cpu"),
|
24 |
)
|
25 |
|
26 |
+
#Transcribe a bulk of audio files
|
27 |
def bulk_transcribe(files, model):
|
28 |
chosen_model = whisper.load_model(model)
|
29 |
output = ""
|
|
|
42 |
|
43 |
return "Transcripci贸n.txt", output
|
44 |
|
45 |
+
#Getting the file name from the path
|
46 |
def get_file_name(file):
|
47 |
file_path = file.split("/")
|
48 |
file_name = file_path[-1]
|
49 |
return file_name
|
50 |
|
51 |
+
#The main function that transcribe each audio file
|
52 |
def transcribe(audio, model):
|
53 |
num_speakers = 3
|
54 |
path, error = convert_to_wav(audio)
|
|
|
103 |
|
104 |
def segment_embedding(path, segment, duration):
|
105 |
start = segment["start"]
|
106 |
+
|
107 |
end = min(duration, segment["end"])
|
108 |
clip = Segment(start, end)
|
109 |
waveform, sample_rate = audio.crop(path, clip)
|