Spaces:
Sleeping
Sleeping
Commit
·
fe5ca0c
1
Parent(s):
edbc5b2
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,6 +30,13 @@ def audio_to_text(audio, num_speakers):
|
|
| 30 |
if duration > 4 * 60 * 60:
|
| 31 |
return "Audio duration too long"
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
result = model.transcribe(path)
|
| 34 |
segments = result["segments"]
|
| 35 |
|
|
|
|
| 30 |
if duration > 4 * 60 * 60:
|
| 31 |
return "Audio duration too long"
|
| 32 |
|
| 33 |
+
|
| 34 |
+
model = whisper.load_model("large-v2")
|
| 35 |
+
embedding_model = PretrainedSpeakerEmbedding(
|
| 36 |
+
"speechbrain/spkrec-ecapa-voxceleb",
|
| 37 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
result = model.transcribe(path)
|
| 41 |
segments = result["segments"]
|
| 42 |
|