Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ from fpdf import FPDF
|
|
31 |
from pathlib import Path
|
32 |
|
33 |
import numpy as np
|
34 |
-
import
|
35 |
import torch
|
36 |
from transformers import pipeline
|
37 |
|
@@ -77,7 +77,8 @@ def transcribe(file_upload, progress=gr.Progress(track_tqdm=True)):
|
|
77 |
|
78 |
# -- convert audio chunk to format for pipeline
|
79 |
chunk_file = "temp_chunk.wav"
|
80 |
-
|
|
|
81 |
|
82 |
# -- chnk ad transcriptrauma
|
83 |
chunk_text = pipe(chunk_file)["text"]
|
|
|
31 |
from pathlib import Path
|
32 |
|
33 |
import numpy as np
|
34 |
+
import soundfile as sf
|
35 |
import torch
|
36 |
from transformers import pipeline
|
37 |
|
|
|
77 |
|
78 |
# -- convert audio chunk to format for pipeline
|
79 |
chunk_file = "temp_chunk.wav"
|
80 |
+
sf.write(chunk_file, chunk, sr)
|
81 |
+
|
82 |
|
83 |
# -- chnk ad transcriptrauma
|
84 |
chunk_text = pipe(chunk_file)["text"]
|