Spaces:
Sleeping
Sleeping
saattrupdan
commited on
Commit
•
cb05e89
1
Parent(s):
4474937
fix: Enforce Danish transcription when using a Whisper-based model (not relevant atm)
Browse files
app.py
CHANGED
@@ -95,7 +95,9 @@ def transcribe_audio(sampling_rate_and_audio: tuple[int, np.ndarray] | None) ->
|
|
95 |
audio = samplerate.resample(audio, 16_000 / sampling_rate, "sinc_best")
|
96 |
|
97 |
logger.info(f"Transcribing audio clip of {len(audio) / 16_000:.2f} seconds...")
|
98 |
-
transcription = transcriber(
|
|
|
|
|
99 |
if not isinstance(transcription, dict):
|
100 |
return ""
|
101 |
|
|
|
95 |
audio = samplerate.resample(audio, 16_000 / sampling_rate, "sinc_best")
|
96 |
|
97 |
logger.info(f"Transcribing audio clip of {len(audio) / 16_000:.2f} seconds...")
|
98 |
+
transcription = transcriber(
|
99 |
+
inputs=audio, generate_kwargs=dict(language="danish", task="transcribe")
|
100 |
+
)
|
101 |
if not isinstance(transcription, dict):
|
102 |
return ""
|
103 |
|