Spaces:
Runtime error
Runtime error
Commit
·
83cf0f6
1
Parent(s):
c757073
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ import moviepy.editor as mp
|
|
| 17 |
import datetime
|
| 18 |
import torch
|
| 19 |
import pyannote.audio
|
| 20 |
-
from pyannote.audio.pipelines.speaker_verification import PyannoteAudioPretrainedSpeakerEmbedding
|
| 21 |
from pyannote.audio import Audio
|
| 22 |
from pyannote.core import Segment
|
| 23 |
import wave
|
|
@@ -141,11 +141,11 @@ def Transcribe_V1(NumberOfSpeakers, SpeakerNames="", audio="temp_audio.wav"):
|
|
| 141 |
|
| 142 |
def Transcribe_V2(num_speakers, speaker_names, audio="temp_audio.wav"):
|
| 143 |
model = whisper.load_model("medium")
|
| 144 |
-
embedding_model =
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
SPEAKER_DICT = {}
|
| 150 |
SPEAKERS = [speaker.strip() for speaker in speaker_names.split(',') if len(speaker)]
|
| 151 |
def GetSpeaker(sp):
|
|
|
|
| 17 |
import datetime
|
| 18 |
import torch
|
| 19 |
import pyannote.audio
|
| 20 |
+
from pyannote.audio.pipelines.speaker_verification import SpeechBrainPretrainedSpeakerEmbedding #PyannoteAudioPretrainedSpeakerEmbedding
|
| 21 |
from pyannote.audio import Audio
|
| 22 |
from pyannote.core import Segment
|
| 23 |
import wave
|
|
|
|
| 141 |
|
| 142 |
def Transcribe_V2(num_speakers, speaker_names, audio="temp_audio.wav"):
|
| 143 |
model = whisper.load_model("medium")
|
| 144 |
+
# embedding_model = SpeechBrainPretrainedSpeakerEmbedding("speechbrain/spkrec-ecapa-voxceleb")
|
| 145 |
+
embedding_model = SpeechBrainPretrainedSpeakerEmbedding(
|
| 146 |
+
"speechbrain/spkrec-ecapa-voxceleb",
|
| 147 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 148 |
+
)
|
| 149 |
SPEAKER_DICT = {}
|
| 150 |
SPEAKERS = [speaker.strip() for speaker in speaker_names.split(',') if len(speaker)]
|
| 151 |
def GetSpeaker(sp):
|