Update asr.py
Browse files
asr.py
CHANGED
@@ -22,7 +22,8 @@ def transcribe(audio):
|
|
22 |
if audio is None:
|
23 |
return "ERROR: You have to either use the microphone or upload an audio file"
|
24 |
|
25 |
-
|
|
|
26 |
inputs = processor(audio_samples, sampling_rate=ASR_SAMPLING_RATE, return_tensors="pt")
|
27 |
|
28 |
# Set language ID for Faroese
|
|
|
22 |
if audio is None:
|
23 |
return "ERROR: You have to either use the microphone or upload an audio file"
|
24 |
|
25 |
+
logging.info(f"Loading audio file: {audio}")
|
26 |
+
audio_samples, _ = librosa.load(audio, sr=ASR_SAMPLING_RATE, mono=True)
|
27 |
inputs = processor(audio_samples, sampling_rate=ASR_SAMPLING_RATE, return_tensors="pt")
|
28 |
|
29 |
# Set language ID for Faroese
|