Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -105,7 +105,9 @@ def transcribe_audio(audio_file, chunk_length_s=30):
|
|
105 |
chunk_waveform = torch.mean(chunk_waveform, dim=0, keepdim=True)
|
106 |
|
107 |
# Process the chunk with the tokenizer
|
|
|
108 |
inputs = processor(chunk_waveform.squeeze(0).numpy(), sampling_rate=sample_rate, return_tensors="pt")
|
|
|
109 |
input_features = inputs.input_features
|
110 |
|
111 |
# Create attention mask
|
@@ -257,7 +259,7 @@ def save_to_pdf(text, summary):
|
|
257 |
iface = gr.Blocks()
|
258 |
|
259 |
with iface:
|
260 |
-
gr.HTML('<img src="https://huggingface.co/spaces/camparchimedes/ola_s-audioshop/
|
261 |
gr.Markdown("**Switch Work's JoJo-versjon som webapp for transkribering av lydfiler til norsk skrift. Språkmodell: NbAiLab/nb-whisper-large, Ekstra: oppsummering, pdf-download**")
|
262 |
|
263 |
with gr.Tabs():
|
|
|
105 |
chunk_waveform = torch.mean(chunk_waveform, dim=0, keepdim=True)
|
106 |
|
107 |
# Process the chunk with the tokenizer
|
108 |
+
processor = tokenizer.add_special_tokens({'pad_token': '[PAD]'})
|
109 |
inputs = processor(chunk_waveform.squeeze(0).numpy(), sampling_rate=sample_rate, return_tensors="pt")
|
110 |
+
|
111 |
input_features = inputs.input_features
|
112 |
|
113 |
# Create attention mask
|
|
|
259 |
iface = gr.Blocks()
|
260 |
|
261 |
with iface:
|
262 |
+
gr.HTML('<img src="https://huggingface.co/spaces/camparchimedes/ola_s-audioshop/raw/main/banner_trans.png" width="100%" height="auto"/>')
|
263 |
gr.Markdown("**Switch Work's JoJo-versjon som webapp for transkribering av lydfiler til norsk skrift. Språkmodell: NbAiLab/nb-whisper-large, Ekstra: oppsummering, pdf-download**")
|
264 |
|
265 |
with gr.Tabs():
|