Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,8 @@ import spaces
|
|
4 |
import contextlib
|
5 |
import warnings
|
6 |
warnings.filterwarnings("ignore")
|
|
|
|
|
7 |
from pydub import AudioSegment
|
8 |
|
9 |
# If m4a audio, convert to wav (Python)
|
@@ -14,19 +16,6 @@ def convert_to_wav(audio_file):
|
|
14 |
return wav_file
|
15 |
|
16 |
import torch
|
17 |
-
|
18 |
-
# torch_dtype = torch.float32
|
19 |
-
#MODEL_NAME = "NbAiLabBeta/nb-whisper-large"
|
20 |
-
|
21 |
-
#pipe = pipeline(
|
22 |
-
#task="automatic-speech-recognition",
|
23 |
-
#model=MODEL_NAME,
|
24 |
-
#chunk_length_s=30,
|
25 |
-
#device=device,
|
26 |
-
)
|
27 |
-
|
28 |
-
#pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language="no", task="transcribe")
|
29 |
-
|
30 |
from transformers import pipeline
|
31 |
|
32 |
pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large")
|
|
|
4 |
import contextlib
|
5 |
import warnings
|
6 |
warnings.filterwarnings("ignore")
|
7 |
+
|
8 |
+
|
9 |
from pydub import AudioSegment
|
10 |
|
11 |
# If m4a audio, convert to wav (Python)
|
|
|
16 |
return wav_file
|
17 |
|
18 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
from transformers import pipeline
|
20 |
|
21 |
pipe = pipeline("automatic-speech-recognition", model="NbAiLab/nb-whisper-large")
|