Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ def load_data(input_file):
|
|
25 |
speech = librosa.resample(speech, sample_rate,16000)
|
26 |
return speech
|
27 |
def write_to_file(input_file):
|
28 |
-
scipy.io.wavfile.write("microphone-
|
29 |
# with open("microphone-results.wav", "wb") as f:
|
30 |
# f.write(input_file.get_wav_data())
|
31 |
# import base64
|
@@ -39,8 +39,8 @@ def write_to_file(input_file):
|
|
39 |
# return (' '.join([s.replace(s[0],s[0].capitalize(),1) for s in sentences]))
|
40 |
pipe = pipeline(model="Shubham09/whisper31filescheck") # change to "your-username/the-name-you-picked"
|
41 |
|
42 |
-
def asr_transcript(input_file="microphone-
|
43 |
-
text = pipe("microphone-
|
44 |
return text
|
45 |
|
46 |
# speech = load_data(input_file)
|
|
|
25 |
speech = librosa.resample(speech, sample_rate,16000)
|
26 |
return speech
|
27 |
def write_to_file(input_file):
|
28 |
+
scipy.io.wavfile.write("microphone-result.wav")
|
29 |
# with open("microphone-results.wav", "wb") as f:
|
30 |
# f.write(input_file.get_wav_data())
|
31 |
# import base64
|
|
|
39 |
# return (' '.join([s.replace(s[0],s[0].capitalize(),1) for s in sentences]))
|
40 |
pipe = pipeline(model="Shubham09/whisper31filescheck") # change to "your-username/the-name-you-picked"
|
41 |
|
42 |
+
def asr_transcript(input_file="microphone-result.wav"):
|
43 |
+
text = pipe("microphone-result.wav")["text"]
|
44 |
return text
|
45 |
|
46 |
# speech = load_data(input_file)
|