Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,10 +25,12 @@ def load_data(input_file):
|
|
25 |
speech = librosa.resample(speech, sample_rate,16000)
|
26 |
return speech
|
27 |
def write_to_file(input_file):
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
wav_file.
|
|
|
|
|
32 |
|
33 |
# def correct_casing(input_sentence):
|
34 |
|
@@ -36,8 +38,8 @@ def write_to_file(input_file):
|
|
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(input_file="
|
40 |
-
text = pipe(
|
41 |
return text
|
42 |
|
43 |
# speech = load_data(input_file)
|
|
|
25 |
speech = librosa.resample(speech, sample_rate,16000)
|
26 |
return speech
|
27 |
def write_to_file(input_file):
|
28 |
+
with open("microphone-results.wav", "wb") as f:
|
29 |
+
f.write(input_file.get_wav_data())
|
30 |
+
# import base64
|
31 |
+
# wav_file = open("temp.wav", "wb")
|
32 |
+
# decode_string = base64.b64decode(input_file)
|
33 |
+
# wav_file.write(decode_string)
|
34 |
|
35 |
# def correct_casing(input_sentence):
|
36 |
|
|
|
38 |
# return (' '.join([s.replace(s[0],s[0].capitalize(),1) for s in sentences]))
|
39 |
pipe = pipeline(model="Shubham09/whisper31filescheck") # change to "your-username/the-name-you-picked"
|
40 |
|
41 |
+
def asr_transcript(input_file="microphone-results.wav"):
|
42 |
+
text = pipe("microphone-results.wav")["text"]
|
43 |
return text
|
44 |
|
45 |
# speech = load_data(input_file)
|