Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -396,13 +396,8 @@ def whisper(filename):
|
|
396 |
st.write(f'Could not open or read {filename}')
|
397 |
#try:
|
398 |
WHISPER_API_URL = 'https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud'
|
399 |
-
WHISPER_headers = {
|
400 |
-
"Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
401 |
-
"Content-Type": "audio/wav"
|
402 |
-
}
|
403 |
response = requests.post(WHISPER_API_URL, headers=WHISPER_headers, data=data)
|
404 |
-
#except:
|
405 |
-
# st.write('Whisper Voice Speech to Text Model is asleep. Starting up now on T4 - please give 3 minutes then retry as KEDA scales up from zero to activate running container(s).')
|
406 |
return response.json()
|
407 |
|
408 |
def whisper_generate_filename(prompt, file_type):
|
@@ -419,7 +414,7 @@ def whisper_save_and_play_audio(audio_recorder):
|
|
419 |
with open(filename, 'wb') as f:
|
420 |
f.write(audio_bytes)
|
421 |
st.audio(audio_bytes, format="audio/wav")
|
422 |
-
st.markdown('Written file {filename}')
|
423 |
return filename
|
424 |
|
425 |
def whisper_transcribe_audio(filename):
|
|
|
396 |
st.write(f'Could not open or read {filename}')
|
397 |
#try:
|
398 |
WHISPER_API_URL = 'https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud'
|
399 |
+
WHISPER_headers = { "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","Content-Type": "audio/wav" }
|
|
|
|
|
|
|
400 |
response = requests.post(WHISPER_API_URL, headers=WHISPER_headers, data=data)
|
|
|
|
|
401 |
return response.json()
|
402 |
|
403 |
def whisper_generate_filename(prompt, file_type):
|
|
|
414 |
with open(filename, 'wb') as f:
|
415 |
f.write(audio_bytes)
|
416 |
st.audio(audio_bytes, format="audio/wav")
|
417 |
+
st.markdown('Written file {filename}', filename)
|
418 |
return filename
|
419 |
|
420 |
def whisper_transcribe_audio(filename):
|