Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -388,16 +388,14 @@ def get_zip_download_link(zip_file):
|
|
388 |
return href
|
389 |
|
390 |
def whisper(filename):
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
WHISPER_headers = { "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","Content-Type": "audio/wav" }
|
400 |
-
response = requests.post('https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud', headers=WHISPER_headers, data=data)
|
401 |
st.write(response)
|
402 |
return response.json()
|
403 |
|
|
|
388 |
return href
|
389 |
|
390 |
def whisper(filename):
|
391 |
+
with open(filename, "rb") as f:
|
392 |
+
data = f.read
|
393 |
+
API_URL = f'https://tonpixzfvq3791u9.us-east-1.aws.endpoints.huggingface.cloud'
|
394 |
+
headers = {
|
395 |
+
"Authorization": "Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
396 |
+
"Content-Type": "audio/wav"
|
397 |
+
}
|
398 |
+
response = requests.post(API_URL, headers data)
|
|
|
|
|
399 |
st.write(response)
|
400 |
return response.json()
|
401 |
|