Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -50,7 +50,7 @@ def pipe(file, return_timestamps=False,lang_nn=False):
|
|
50 |
task="transcribe",
|
51 |
no_timestamps=not return_timestamps,
|
52 |
)
|
53 |
-
return asr(file, return_timestamps=return_timestamps
|
54 |
|
55 |
def format_output(text):
|
56 |
# Add a line break after ".", "!", ":", or "?" unless part of sequences like "..."
|
@@ -65,6 +65,9 @@ def transcribe(file, return_timestamps=False,lang_nn=False):
|
|
65 |
audio_duration = waveform.size(1) / sample_rate
|
66 |
|
67 |
if audio_duration > max_audio_length:
|
|
|
|
|
|
|
68 |
# Trim the waveform to the first 30 minutes
|
69 |
waveform = waveform[:, :int(max_audio_length * sample_rate)]
|
70 |
truncated_file = "truncated_audio.wav"
|
|
|
50 |
task="transcribe",
|
51 |
no_timestamps=not return_timestamps,
|
52 |
)
|
53 |
+
return asr(file, return_timestamps=return_timestamps batch_size=24)
|
54 |
|
55 |
def format_output(text):
|
56 |
# Add a line break after ".", "!", ":", or "?" unless part of sequences like "..."
|
|
|
65 |
audio_duration = waveform.size(1) / sample_rate
|
66 |
|
67 |
if audio_duration > max_audio_length:
|
68 |
+
warning_message = (
|
69 |
+
"⚠️ Advarsel: Lydfilen din er lengre enn 30 minutter. Kun de første 30 minuttene vil bli transkribert.\n"
|
70 |
+
)
|
71 |
# Trim the waveform to the first 30 minutes
|
72 |
waveform = waveform[:, :int(max_audio_length * sample_rate)]
|
73 |
truncated_file = "truncated_audio.wav"
|