Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,9 @@ import numpy as np
|
|
5 |
|
6 |
from transformers import WhisperProcessor, WhisperForConditionalGeneration, pipeline
|
7 |
|
8 |
-
|
9 |
-
|
|
|
10 |
|
11 |
def transcribe(audio):
|
12 |
audio_input, _ = librosa.load(audio, sr=16000)
|
|
|
5 |
|
6 |
from transformers import WhisperProcessor, WhisperForConditionalGeneration, pipeline
|
7 |
|
8 |
+
hf_token = os.getenv("HUGGINGFACE_HUB_TOKEN")
|
9 |
+
processor = WhisperProcessor.from_pretrained("akadriu/whisper-medium-sq", token=hf_token)
|
10 |
+
model = WhisperForConditionalGeneration.from_pretrained("akadriu/whisper-medium-sq", token=hf_token)
|
11 |
|
12 |
def transcribe(audio):
|
13 |
audio_input, _ = librosa.load(audio, sr=16000)
|