Spaces:
Running
Running
ageraustine
commited on
Commit
•
a43a1a0
1
Parent(s):
8a74b08
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import librosa
|
3 |
-
import httpx # Recommended library for efficient HTTP requests
|
4 |
import numpy as np
|
|
|
5 |
import os
|
6 |
|
7 |
# Replace with your actual API endpoint URL
|
@@ -18,8 +18,8 @@ headers = {
|
|
18 |
|
19 |
def query(payload):
|
20 |
"""Sends a POST request to the API endpoint with the given payload."""
|
21 |
-
response =
|
22 |
-
return response.json()
|
23 |
|
24 |
|
25 |
def main():
|
|
|
1 |
import streamlit as st
|
2 |
import librosa
|
|
|
3 |
import numpy as np
|
4 |
+
import requests
|
5 |
import os
|
6 |
|
7 |
# Replace with your actual API endpoint URL
|
|
|
18 |
|
19 |
def query(payload):
|
20 |
"""Sends a POST request to the API endpoint with the given payload."""
|
21 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
22 |
+
return response.json()
|
23 |
|
24 |
|
25 |
def main():
|