Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,11 @@ def load_data(input_file):
|
|
24 |
if sample_rate !=16000:
|
25 |
speech = librosa.resample(speech, sample_rate,16000)
|
26 |
return speech
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
# def correct_casing(input_sentence):
|
29 |
|
@@ -31,7 +36,7 @@ def load_data(input_file):
|
|
31 |
# return (' '.join([s.replace(s[0],s[0].capitalize(),1) for s in sentences]))
|
32 |
pipe = pipeline(model="Shubham09/whisper31filescheck") # change to "your-username/the-name-you-picked"
|
33 |
|
34 |
-
def asr_transcript(
|
35 |
text = pipe(input_file)["text"]
|
36 |
return text
|
37 |
|
|
|
24 |
if sample_rate !=16000:
|
25 |
speech = librosa.resample(speech, sample_rate,16000)
|
26 |
return speech
|
27 |
+
def write_to_file(input_file):
|
28 |
+
import base64
|
29 |
+
wav_file = open("temp.wav", "wb")
|
30 |
+
decode_string = base64.b64decode(input_file)
|
31 |
+
wav_file.write(decode_string)
|
32 |
|
33 |
# def correct_casing(input_sentence):
|
34 |
|
|
|
36 |
# return (' '.join([s.replace(s[0],s[0].capitalize(),1) for s in sentences]))
|
37 |
pipe = pipeline(model="Shubham09/whisper31filescheck") # change to "your-username/the-name-you-picked"
|
38 |
|
39 |
+
def asr_transcript("temp.wav"):
|
40 |
text = pipe(input_file)["text"]
|
41 |
return text
|
42 |
|