Spaces:
Runtime error
Runtime error
Commit
·
0c2114f
1
Parent(s):
81ba7e1
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
-
import time
|
4 |
from pyannote.audio import Pipeline
|
5 |
import librosa, torch
|
6 |
from transformers import pipeline
|
@@ -14,8 +14,8 @@ device = 0 if torch.cuda.is_available() else "cpu"
|
|
14 |
SAMPLE_RATE = 16_000
|
15 |
|
16 |
######## LOAD MODELS FROM HUB ########
|
17 |
-
dia_model = Pipeline.from_pretrained("pyannote/speaker-diarization", use_auth_token=
|
18 |
-
vad_model = Pipeline.from_pretrained("pyannote/voice-activity-detection", use_auth_token=
|
19 |
pipe = pipeline(task="automatic-speech-recognition", model=MODEL_NAME, chunk_length_s=chunk_length_s, device=device)
|
20 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
|
21 |
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
+
import os, time
|
4 |
from pyannote.audio import Pipeline
|
5 |
import librosa, torch
|
6 |
from transformers import pipeline
|
|
|
14 |
SAMPLE_RATE = 16_000
|
15 |
|
16 |
######## LOAD MODELS FROM HUB ########
|
17 |
+
dia_model = Pipeline.from_pretrained("pyannote/speaker-diarization", use_auth_token=os.environ['TOKEN'])
|
18 |
+
vad_model = Pipeline.from_pretrained("pyannote/voice-activity-detection", use_auth_token=os.environ['TOKEN'])
|
19 |
pipe = pipeline(task="automatic-speech-recognition", model=MODEL_NAME, chunk_length_s=chunk_length_s, device=device)
|
20 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
|
21 |
|